OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-manage-profile' is the settings subpage containing controls to | 7 * 'settings-manage-profile' is the settings subpage containing controls to |
8 * edit a profile's name, icon, and desktop shortcut. | 8 * edit a profile's name, icon, and desktop shortcut. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 handleAvailableIcons_: function(iconUrls) { | 45 handleAvailableIcons_: function(iconUrls) { |
46 this.availableIconUrls = iconUrls; | 46 this.availableIconUrls = iconUrls; |
47 }, | 47 }, |
48 | 48 |
49 /** | 49 /** |
50 * Handler for when the profile name field is changed, then blurred. | 50 * Handler for when the profile name field is changed, then blurred. |
51 * @private | 51 * @private |
52 * @param {!Event} event | 52 * @param {!Event} event |
53 */ | 53 */ |
54 onProfileNameChanged_: function(event) { | 54 onProfileNameChanged_: function(event) { |
| 55 if (event.target.invalid) |
| 56 return; |
| 57 |
55 settings.SyncPrivateApi.setProfileIconAndName(this.profileIconUrl, | 58 settings.SyncPrivateApi.setProfileIconAndName(this.profileIconUrl, |
56 event.target.value); | 59 event.target.value); |
57 }, | 60 }, |
58 | 61 |
59 /** | 62 /** |
60 * Handler for when the user clicks a new profile icon. | 63 * Handler for when the user clicks a new profile icon. |
61 * @private | 64 * @private |
62 * @param {!Event} event | 65 * @param {!Event} event |
63 */ | 66 */ |
64 onIconTap_: function(event) { | 67 onIconTap_: function(event) { |
(...skipping 19 matching lines...) Expand all Loading... |
84 * Computed binding determining which profile icon button is toggled on. | 87 * Computed binding determining which profile icon button is toggled on. |
85 * @private | 88 * @private |
86 * @param {!string} iconUrl | 89 * @param {!string} iconUrl |
87 * @param {!string} paramIconUrl | 90 * @param {!string} paramIconUrl |
88 * @return {boolean} | 91 * @return {boolean} |
89 */ | 92 */ |
90 isActiveIcon_: function(iconUrl, profileIconUrl) { | 93 isActiveIcon_: function(iconUrl, profileIconUrl) { |
91 return iconUrl == profileIconUrl; | 94 return iconUrl == profileIconUrl; |
92 }, | 95 }, |
93 }); | 96 }); |
OLD | NEW |