-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoDiscover configuration ignored #15
Comments
I solved. public $js = [
"dropzone/dist/min/dropzone.min.js"
]; to public $js = [
"dropzone/dist/dropzone.js"
]; now open dropzone.js and change |
感谢楼上大神的回答,解决了我的问题,另一种方式可以修改dropzone/dist/dropzone.js的Dropzone.autoDiscover = false, 然后使用压缩工具压缩并覆盖"dropzone/dist/min/dropzone.min.js" |
Problem has been solved in my last pull request. @perminder-klair Please check it and merge |
@mrstroz thanks, I can't test it right now but is looking good (much better/simple than my workaround). I'll give it a try as soon as I get some spare time |
@xenogenesi Can you merge this PR? |
@whizsid nope sorry, @perminder-klair should do it, but you can clone @mrstroz 's repository meanwhile |
I'm using Chromium (Chrome) and I've a couple of errors in the javascript console:
registerJs()
by default bind/wrap its code to theonready
event (using jQuery) and this addon use it to configure the AutoDiscover option to true or false.asset::register()
doesn't bind/wrap to anything, as it should be for any javascript library/module, it is included at the end of the body after its dependencies and executed as soon as possible.The problem is that DropZone, at least the version used by this addon, execute as soon as possible a
contentLoaded
function that seems to bind to theonload
event, when the content is loaded the autoDiscover start.So what is happening (at least on the Chromium I'm using) is that the DropZone's autoDiscover function is executed before the addon javascript set the autoDiscover configuration.
Currently the only solution I've found is to add a new asset, with the js code to disable the autoDiscover, add to it DropZoneAsset as dependency, and in DropZone.php register it instead, but is far from optimal.
The text was updated successfully, but these errors were encountered: