cdowdy / bolt-tinypng

Bolt Extension Using TinyPNG API to optimize images
7 stars 2 forks source link

TinyPNG's dropzone code throws error on non tinypng pages #11

Closed cdowdy closed 7 years ago

cdowdy commented 7 years ago

I left autodiscover on :) so Dropzone js will try to find our upload form on backend pages that don't use the tinypng api/extension all that jazz.

Specifically:

Uncaught Error: No URL provided.
    at new Dropzone (dropzone.js:440)
    at Function.Dropzone.discover (dropzone.js:1479)
    at Dropzone._autoDiscoverFunction (dropzone.js:1761)
    at HTMLDocument.init (dropzone.js:1730)  

So we'll turn off autodisover since we can't restrict our custom pages/extensions to particular backend pages and init it only when the id of our form is found. Hopefully this doesn't break anything haha.