this.showAvatarGridOrSubmit_.bind(this);
$('create-new-user-link').onclick = function(event) {
- OptionsPage.closeOverlay();
+ options.ManagedUserListData.removeObserver(self);
OptionsPage.navigateToPage('createProfile');
};
},
didShowPage: function() {
options.ManagedUserListData.requestExistingManagedUsers().then(
this.receiveExistingManagedUsers_, this.onSigninError_.bind(this));
+ options.ManagedUserListData.addObserver(this);
this.updateImportInProgress_(false);
$('managed-user-import-error-bubble').hidden = true;
},
/**
+ * @override
+ */
+ didClosePage: function() {
+ options.ManagedUserListData.removeObserver(this);
+ },
+
+ /**
* Called when the user clicks the "OK" button. In case the managed
* user being imported has no avatar in sync, it shows the avatar
* icon grid. In case the avatar grid is visible or the managed user
// 'createProfile' is handled by CreateProfileHandler.
chrome.send('createProfile', [managedUser.name, avatarUrl,
false, true, managedUser.id]);
- options.ManagedUserListData.reloadExistingManagedUsers();
},
/**
},
/**
- * Closes the overlay if importing the managed user was successful.
+ * Closes the overlay if importing the managed user was successful. Also
+ * reset the cached list of managed users in order to get an updated list
+ * when the overlay is reopened.
* @private
*/
onSuccess_: function() {
this.updateImportInProgress_(false);
+ options.ManagedUserListData.resetPromise();
OptionsPage.closeOverlay();
},
};