Skip to content

Commit 5c2634e

Browse files
committed
Update assets to v9.11.0
1 parent 13a13d7 commit 5c2634e

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

app/assets/javascripts/jquery-fileupload/jquery.fileupload-angular.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
angular.forEach(data.files, function (file) {
9292
filesCopy.push(file);
9393
});
94-
scope.$apply(function () {
94+
scope.$parent.$applyAsync(function () {
9595
addFileMethods(scope, data);
9696
var method = scope.option('prependFiles') ?
9797
'unshift' : 'push';
@@ -100,7 +100,7 @@
100100
data.process(function () {
101101
return scope.process(data);
102102
}).always(function () {
103-
scope.$apply(function () {
103+
scope.$parent.$applyAsync(function () {
104104
addFileMethods(scope, data);
105105
scope.replace(filesCopy, data.files);
106106
});
@@ -320,9 +320,11 @@
320320
'fileuploadprocessalways',
321321
'fileuploadprocessstop'
322322
].join(' '), function (e, data) {
323-
if ($scope.$emit(e.type, data).defaultPrevented) {
324-
e.preventDefault();
325-
}
323+
$scope.$parent.$applyAsync(function () {
324+
if ($scope.$emit(e.type, data).defaultPrevented) {
325+
e.preventDefault();
326+
}
327+
});
326328
}).on('remove', function () {
327329
// Remove upload methods from the scope,
328330
// when the widget is removed:

app/assets/javascripts/jquery-fileupload/jquery.fileupload-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
blob.name = file.name;
243243
} else if (file.name) {
244244
blob.name = file.name.replace(
245-
/\..+$/,
245+
/\.\w+$/,
246246
'.' + blob.type.substr(6)
247247
);
248248
}

app/assets/javascripts/jquery-fileupload/jquery.fileupload.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@
277277
// The following are jQuery ajax settings required for the file uploads:
278278
processData: false,
279279
contentType: false,
280-
cache: false
280+
cache: false,
281+
timeout: 0
281282
},
282283

283284
// A list of options that require reinitializing event listeners and/or
@@ -983,7 +984,10 @@
983984
fileSet,
984985
i,
985986
j = 0;
986-
if (limitSize && (!filesLength || files[0].size === undefined)) {
987+
if (!filesLength) {
988+
return false;
989+
}
990+
if (limitSize && files[0].size === undefined) {
987991
limitSize = undefined;
988992
}
989993
if (!(options.singleFileUploads || limit || limitSize) ||

app/assets/stylesheets/jquery.fileupload.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
.fileinput-button {
1414
position: relative;
1515
overflow: hidden;
16+
display: inline-block;
1617
}
1718
.fileinput-button input {
1819
position: absolute;

0 commit comments

Comments
 (0)