Skip to content

Commit fc1b216

Browse files
committed
Fix #1858: Correct Plugin Options & Themes Init
1 parent fb2ebb4 commit fc1b216

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
55

66
**Date**: _under development_
77

8+
- (bug #1858): Correct Plugin Options & Themes Initialization.
89
- (bug #1857): Correct Finnish Translations.
910
- (enh # 1833): Fix compliance with CSP not having unsafe-inline policy.
1011

js/fileinput.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7174,10 +7174,11 @@
71747174
retvals = [];
71757175
args.shift();
71767176
this.each(function () {
7177-
var options = {};
7177+
var options = {}, optObj = {};
71787178
if (typeof option === "object") {
71797179
options = $.extend(true, {}, $.fn.fileinput.defaults, option);
7180-
}
7180+
optObj = option;
7181+
}
71817182
var self = $(this),
71827183
data = self.data("fileinput"),
71837184
theme = options.theme || self.data("theme") || $.fn.fileinput.defaults.theme,
@@ -7192,7 +7193,7 @@
71927193
if (lang !== "en" && !$h.isEmpty($.fn.fileinputLocales[lang])) {
71937194
l = $.fn.fileinputLocales[lang] || {};
71947195
}
7195-
opt = $.extend(true, {}, $.fn.fileinput.defaults, t, $.fn.fileinputLocales.en, l, options, self.data());
7196+
opt = $.extend(true, {}, $.fn.fileinput.defaults, t, $.fn.fileinputLocales.en, l, optObj, self.data());
71967197
data = new FileInput(this, opt);
71977198
self.data("fileinput", data);
71987199
}

js/fileinput.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)