mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Moved image import to worker
This commit is contained in:
@ -17,9 +17,9 @@
|
||||
};
|
||||
|
||||
ns.AbstractDialogController.prototype.setTitle = function (title) {
|
||||
var dialogHead = document.querySelector('.dialog-head');
|
||||
if (dialogHead) {
|
||||
dialogHead.innerText = title;
|
||||
var dialogTitle = document.querySelector('.dialog-title');
|
||||
if (dialogTitle) {
|
||||
dialogTitle.innerText = title;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -111,10 +111,16 @@
|
||||
ns.CreatePaletteController.prototype.onFileInputChange_ = function (evt) {
|
||||
var files = this.hiddenFileInput.files;
|
||||
if (files.length == 1) {
|
||||
this.paletteImportService.read(files[0], this.setPalette_.bind(this));
|
||||
this.paletteImportService.read(files[0], this.setPalette_.bind(this), this.displayErrorMessage_.bind(this));
|
||||
}
|
||||
};
|
||||
|
||||
ns.CreatePaletteController.prototype.displayErrorMessage_ = function (message) {
|
||||
message = "Could not import palette : " + message;
|
||||
$.publish(Events.SHOW_NOTIFICATION, [{"content": message}]);
|
||||
window.setTimeout($.publish.bind($, Events.HIDE_NOTIFICATION), 2000);
|
||||
};
|
||||
|
||||
ns.CreatePaletteController.prototype.onNameInputChange_ = function (evt) {
|
||||
this.palette.name = pskl.utils.escapeHtml(this.nameInput.value);
|
||||
};
|
||||
|
Reference in New Issue
Block a user