Issue #277 : Add isSaving state to storageService

This commit is contained in:
jdescottes
2015-09-20 11:19:17 +02:00
parent e5be581e19
commit fe9875841a
3 changed files with 53 additions and 23 deletions

View File

@@ -32,9 +32,6 @@
this.addEventListener(this.saveBrowserButton, 'click', this.saveBrowser_);
this.addEventListener('form[name=save-form]', 'submit', this.onSaveFormSubmit_);
$.subscribe(Events.BEFORE_SAVING_PISKEL, this.disableSaveButtons_.bind(this));
$.subscribe(Events.AFTER_SAVING_PISKEL, this.enableSaveButtons_.bind(this));
if (pskl.app.isLoggedIn()) {
this.authenticatedUserInit_();
}
@@ -42,6 +39,13 @@
if (pskl.utils.Environment.detectNodeWebkit()) {
this.desktopApplicationInit_();
}
$.subscribe(Events.BEFORE_SAVING_PISKEL, this.disableSaveButtons_.bind(this));
$.subscribe(Events.AFTER_SAVING_PISKEL, this.enableSaveButtons_.bind(this));
if (pskl.app.storageService.isSaving()) {
this.disableSaveButtons_();
}
};
ns.SaveController.prototype.authenticatedUserInit_ = function () {