Skip to content

Commit

Permalink
fix(pat-upload): Prevent duplicate initialization of the dropzone.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Jul 21, 2023
1 parent 231c8ee commit 5e15a78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pat/upload/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import $ from "jquery";
import _ from "underscore";
import _t from "../../core/i18n-wrapper";
import Base from "@patternslib/patternslib/src/core/base";
import logger from "@patternslib/patternslib/src/core/logging";
import utils from "../../core/utils";

const log = logger.getLogger("pat-upload");

let Dropzone;

export default Base.extend({
Expand Down Expand Up @@ -61,6 +64,11 @@ export default Base.extend({

var self = this;

if (self.$el.find(".upload-area").length) {
log.info("Found already a dropzone on element, skipping!");
return;
}

if (typeof self.options.allowPathSelection === "undefined") {
// Set allowPathSelection to true, if we can use path based urls.
self.options.allowPathSelection =
Expand Down

0 comments on commit 5e15a78

Please sign in to comment.