carstenschaefer / DrawerJs

A customizable WYSIWYG HTML canvas editor.
https://www.drawerjs.com
MIT License
556 stars 113 forks source link

In some explorer won't show the file selection dialog #49

Open magicgis opened 4 years ago

magicgis commented 4 years ago

In some explorer won't show the file selection dialog,because in the "_showDialog" function,the element input should putinto the document node,here is the original code: ImageTool.prototype._showDialog = function() { var acceptedMIMEStr = this.options.acceptedMIMETypes.join(','); var $el = $(''); $el.on('change', this._processFileInput.bind(this)); $el.click(); }; and the below one will work:

ImageTool.prototype._showDialog = function() { var acceptedMIMEStr = this.options.acceptedMIMETypes.join(','); var $el = $(''); $el.on('change', this._processFileInput.bind(this)); $(document.body).append($el); $el.click(); $(document.body).remove($el); };

and also the BackgroundImageTool plugin in the "BackgroundImageTool.prototype._showDialog" function should modify as above。

extremeCrazyCoder commented 4 years ago

you could create a PR for that didn't experience that myself, but I could think that some browsers are picky about that