mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix #322 : Save As button no longer works on offline builds
This commit is contained in:
@@ -25,13 +25,16 @@
|
|||||||
deferred.resolve(fileInputElement.value);
|
deferred.resolve(fileInputElement.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
fileInputElement.click();
|
// fix for issue #322 :
|
||||||
|
window.setTimeout(function () {
|
||||||
fileInputElement.addEventListener('change', changeListener);
|
fileInputElement.click();
|
||||||
// there is no way to detect a cancelled fileInput popup
|
fileInputElement.addEventListener('change', changeListener);
|
||||||
// as a crappy workaround we add a click listener on the document
|
// there is no way to detect a cancelled fileInput popup
|
||||||
// on top the change event listener
|
// as a crappy workaround we add a click listener on the document
|
||||||
document.addEventListener('click', changeListener);
|
// on top the change event listener
|
||||||
|
// todo : listen to dirty check instead
|
||||||
|
document.addEventListener('mousedown', changeListener);
|
||||||
|
}, 50);
|
||||||
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user