1
0
Fork 0
mirror of https://github.com/silentsakky/zarafa-webapp-passwd synced 2026-08-05 23:11:25 +02:00

only chnage password when category is visible

show saving mask
This commit is contained in:
Saket Patel 2013-10-17 03:33:06 +05:30
commit 227bb4a886
3 changed files with 104 additions and 17 deletions

View file

@ -27,6 +27,82 @@ Zarafa.plugins.passwd.settings.SettingsPasswdCategory = Ext.extend(Zarafa.settin
});
Zarafa.plugins.passwd.settings.SettingsPasswdCategory.superclass.constructor.call(this, config);
},
/**
* Called by superclass when the Category has been deselected and is hidden from the user,
* this will unregister the {@link #onBeforeSaveRules} event handler.
* @private
*/
onHide : function()
{
Zarafa.common.settings.SettingsRuleCategory.superclass.onHide.apply(this, arguments);
// Unregister the 'beforesave' event. This could be lingering when
// 'savesettings' was fired but it was cancelled by one of the
// event handlers.
var panel = this.get(0).passwdPanel;
this.mun(panel, 'beforesave', this.onBeforeSavePasswd, this);
},
/**
* Event handler for the
* {@link Zarafa.settings.SettingsContextModel ContextModel}#{@link Zarafa.settings.SettingsContextModel#beforesavesettings beforesavesettings}
* event. It will reset the {@link #savingElCounter} and his will register the event handler for
* {@link Zarafa.settings.SettingsModel#beforesave beforesave} event.
* @private
*/
onBeforeSaveSettingsModel : function()
{
Zarafa.common.settings.SettingsRuleCategory.superclass.onBeforeSaveSettingsModel.apply(this, arguments);
var panel = this.get(0).passwdPanel;
this.mon(panel, 'beforesave', this.onBeforeSavePasswd, this, { single : true });
},
/**
* Event handler which is fired when the {@link Zarafa.plugins.passwd.settings.PasswdPanel Passwd Panel}
* fires the 'beforesave' event. This will {@link #displaySavingMask show a notification} and register the
* event handlers for the completion of the save.
* @private
*/
onBeforeSavePasswd : function()
{
this.displaySavingMask();
var panel = this.get(0).passwdPanel;
this.mon(panel, 'save', this.onPasswdSave, this);
this.mon(panel, 'exception', this.onPasswdException, this);
},
/**
* Event handler which is fired when the {@link Zarafa.common.rules.data.RulesStore Rules Store}
* fires the 'save' event indicating the successfull save of the rules. This will
* {@link #hideSavingMask hide the notification}.
* @private
*/
onPasswdSave : function()
{
this.hideSavingMask(true);
var panel = this.get(0).passwdPanel;
this.mun(panel, 'save', this.onPasswdSave, this);
this.mun(panel, 'exception', this.onPasswdException, this);
},
/**
* Event handler which is fired when the {@link Zarafa.common.rules.data.RulesStore Rules Store}
* fires the 'exception' event indicating a failing save of the rules. This will
* {@link #hideSavingMask hide the notification}.
* @private
*/
onPasswdException : function()
{
this.hideSavingMask(false);
var panel = this.get(0).passwdPanel;
this.mun(panel, 'save', this.onPasswdSave, this);
this.mun(panel, 'exception', this.onPasswdException, this);
}
});