Commit ae40e483 authored by mahmadi's avatar mahmadi Committed by Commit bot

[MD Settings] manage-Profile resets the name to the current name on route change.

BUG=630118
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2389043003
Cr-Commit-Position: refs/heads/master@{#422882}
parent ee3f3ecc
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
{ {
'target_name': 'manage_profile', 'target_name': 'manage_profile',
'dependencies': [ 'dependencies': [
'../compiled_resources2.gyp:route',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:web_ui_listener_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:web_ui_listener_behavior',
'manage_profile_browser_proxy', 'manage_profile_browser_proxy',
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html">
<link rel="import" href="/people_page/manage_profile_browser_proxy.html"> <link rel="import" href="/people_page/manage_profile_browser_proxy.html">
<link rel="import" href="/route.html">
<link rel="import" href="/settings_shared_css.html"> <link rel="import" href="/settings_shared_css.html">
<dom-module id="settings-manage-profile"> <dom-module id="settings-manage-profile">
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
} }
</style> </style>
<div class="settings-box first"> <div class="settings-box first">
<paper-input id="name" value="{{profileName}}" pattern=".*\S.*" <paper-input id="name" value="[[profileName]]" pattern=".*\S.*"
auto-validate required on-change="onProfileNameChanged_" auto-validate required on-change="onProfileNameChanged_"
disabled="[[isProfileNameDisabled_(syncStatus)]]"> disabled="[[isProfileNameDisabled_(syncStatus)]]">
</paper-input> </paper-input>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
Polymer({ Polymer({
is: 'settings-manage-profile', is: 'settings-manage-profile',
behaviors: [WebUIListenerBehavior], behaviors: [WebUIListenerBehavior, settings.RouteObserverBehavior],
properties: { properties: {
/** /**
...@@ -59,6 +59,12 @@ Polymer({ ...@@ -59,6 +59,12 @@ Polymer({
this.browserProxy_.getAvailableIcons().then(setIcons); this.browserProxy_.getAvailableIcons().then(setIcons);
}, },
/** @protected */
currentRouteChanged: function() {
if (settings.getCurrentRoute() == settings.Route.MANAGE_PROFILE)
this.$.name.value = this.profileName;
},
/** /**
* Handler for when the profile name field is changed, then blurred. * Handler for when the profile name field is changed, then blurred.
* @private * @private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment