Skip to content

Commit 760c956

Browse files
committed
Make sure no error is raised if fileupload element is not present in DOM
1 parent 3cd1e2d commit 760c956

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-ui.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,23 @@
146146
if (file.error) {
147147
that._adjustMaxNumberOfFiles(1);
148148
}
149-
that._transition($(this)).done(
150-
function () {
151-
var node = $(this);
152-
template = that._renderDownload([file])
153-
.css('height', node.height())
154-
.replaceAll(node);
155-
that._forceReflow(template);
156-
that._transition(template).done(
157-
function () {
158-
data.context = $(this);
159-
that._trigger('completed', e, data);
160-
}
161-
);
162-
}
163-
);
149+
if (that) {
150+
that._transition($(this)).done(
151+
function () {
152+
var node = $(this);
153+
template = that._renderDownload([file])
154+
.css('height', node.height())
155+
.replaceAll(node);
156+
that._forceReflow(template);
157+
that._transition(template).done(
158+
function () {
159+
data.context = $(this);
160+
that._trigger('completed', e, data);
161+
}
162+
);
163+
}
164+
);
165+
}
164166
});
165167
} else {
166168
template = that._renderDownload(data.result)

0 commit comments

Comments
 (0)