Fix post merge bugs for desktop mode

This commit is contained in:
jdescottes 2015-04-07 23:54:49 +02:00
parent 4b7b18ca6f
commit 3d6cd3e576
2 changed files with 4 additions and 12 deletions

View File

@ -29,18 +29,14 @@
this.isPublicCheckbox.setAttribute('checked', true); this.isPublicCheckbox.setAttribute('checked', true);
} }
//Environment dependent configuration:
if (pskl.utils.Environment.detectNodeWebkit()) { if (pskl.utils.Environment.detectNodeWebkit()) {
// running in Node-Webkit... // hide "save in browser"
this.addEventListener('#save-file-button', 'click', this.saveFileDesktop);
// hide the "save in browser" part of the gui
var saveInBrowserSection = document.querySelector('#save-in-browser'); var saveInBrowserSection = document.querySelector('#save-in-browser');
saveInBrowserSection.style.display = 'none'; saveInBrowserSection.style.display = 'none';
} else {
// running in browser...
this.addEventListener('#save-file-button', 'click', this.saveFileBrowser_);
} }
this.addEventListener('#save-file-button', 'click', this.saveFile_);
this.addEventListener('#save-browser-button', 'click', this.saveLocal_); this.addEventListener('#save-browser-button', 'click', this.saveLocal_);
this.saveOnlineButton = document.querySelector('#save-online-button'); this.saveOnlineButton = document.querySelector('#save-online-button');
@ -142,10 +138,6 @@
} }
}; };
/**
* @deprecated - renamed "saveFileBrowser_"
* @private
*/
ns.SaveController.prototype.saveFile_ = function () { ns.SaveController.prototype.saveFile_ = function () {
// detect if this is running in NodeWebkit // detect if this is running in NodeWebkit
if (pskl.utils.Environment.detectNodeWebkit()) { if (pskl.utils.Environment.detectNodeWebkit()) {

View File

@ -52,8 +52,8 @@
// TODO: if there is already a file path, use it for the dialog's // TODO: if there is already a file path, use it for the dialog's
// working directory and filename // working directory and filename
pskl.utils.FileUtilsDesktop.saveAs(serialized, null, 'piskel', function (selectedSavePath) { pskl.utils.FileUtilsDesktop.saveAs(serialized, null, 'piskel', function (selectedSavePath) {
this.onSaveSuccess_();
this.piskelController.setSavePath(selectedSavePath); this.piskelController.setSavePath(selectedSavePath);
this.onSaveSuccess_();
}.bind(this)); }.bind(this));
}; };