mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Include save file path in "Successfully Saved" popup. Show full save path under the save button. Hide the "save to browser" portion of the save panel when running in desktop mode.
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
if (pskl.utils.Environment.detectNodeWebkit()) {
|
||||
// running in Node-Webkit...
|
||||
this.saveFileButton.click(this.saveFileDesktop_.bind(this));
|
||||
// hide the "save in browser" part of the gui
|
||||
$('#save-in-browser').css('display', 'none');
|
||||
} else {
|
||||
// running in browser...
|
||||
this.saveFileButton.click(this.saveFileBrowser_.bind(this));
|
||||
@@ -61,9 +63,18 @@
|
||||
};
|
||||
|
||||
ns.SaveController.prototype.updateLocalStatusFilename_ = function () {
|
||||
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-template', {
|
||||
name : this.getLocalFilename_()
|
||||
}));
|
||||
if (pskl.utils.Environment.detectNodeWebkit()) {
|
||||
var fileName = this.piskelController.getSavePath();
|
||||
if (fileName !== null) {
|
||||
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-desktop-template', {
|
||||
name : this.piskelController.getSavePath()
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
this.saveFileStatus.html(pskl.utils.Template.getAndReplace('save-file-status-template', {
|
||||
name : this.getLocalFilename_()
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
ns.SaveController.prototype.getLocalFilename_ = function () {
|
||||
|
||||
@@ -58,13 +58,14 @@
|
||||
};
|
||||
|
||||
ns.DesktopStorageService.prototype.onSaveSuccess_ = function () {
|
||||
var savePath = this.piskelController.getSavePath();
|
||||
$.publish(Events.CLOSE_SETTINGS_DRAWER);
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved !"}]);
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved: " + savePath}]);
|
||||
$.publish(Events.PISKEL_SAVED);
|
||||
// clear the old time out, if any.
|
||||
window.clearTimeout(this.hideNotificationTimeoutID);
|
||||
this.hideNotificationTimeoutID =
|
||||
window.setTimeout($.publish.bind($, Events.HIDE_NOTIFICATION), 2000);
|
||||
window.setTimeout($.publish.bind($, Events.HIDE_NOTIFICATION), 3000);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user