|
|
@@ -247,9 +247,20 @@
|
|
|
var files = e.originalEvent.dataTransfer.files;
|
|
|
enqueueFiles(files);
|
|
|
});
|
|
|
- $dropzone.on('click', function () {
|
|
|
+ $dropzone.on('click', function (e) {
|
|
|
if ($dropzone.hasClass('studiou-fpp-dropzone-disabled')) return;
|
|
|
- $fileInput.trigger('click');
|
|
|
+ // File input lives INSIDE the dropzone, so a click on it bubbles up and
|
|
|
+ // re-enters this handler. On mobile the synthetic .trigger('click') also
|
|
|
+ // bubbles, producing infinite recursion ("Maximum call stack size exceeded").
|
|
|
+ // Ignore clicks that originate on (or bubble from) the input itself.
|
|
|
+ if (e.target === $fileInput[0]) return;
|
|
|
+ // Use the native .click() on the DOM element — it opens the file picker
|
|
|
+ // without dispatching a bubbling jQuery event that would re-trigger us.
|
|
|
+ $fileInput[0].click();
|
|
|
+ });
|
|
|
+ $fileInput.on('click', function (e) {
|
|
|
+ // Defense in depth: stop the click from bubbling back to the dropzone.
|
|
|
+ e.stopPropagation();
|
|
|
});
|
|
|
$fileInput.on('change', function () {
|
|
|
enqueueFiles(this.files);
|