Moved image import to worker

This commit is contained in:
jdescottes
2014-09-20 09:14:21 +02:00
parent 9afe69cb87
commit 6445b44d02
19 changed files with 486 additions and 154 deletions

View File

@ -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;
}
};

View File

@ -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);
};