Skip to content

Commit

Permalink
Fixes bug where the defaults are changed everytime a new selectpicker…
Browse files Browse the repository at this point in the history
… is instanciated
  • Loading branch information
t0xicCode committed Aug 19, 2014
1 parent 4a30a5b commit a1db054
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions dist/js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@
function Plugin (option, event) {
// get the args of the outer function..
var args = arguments;
// The arguments of the function are explicitely re-defined from the argument list, because the shift causes them
// The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
// to get lost
//noinspection JSDuplicatedDeclaration
var option = args[0],
Expand All @@ -996,7 +996,7 @@
options = typeof option == 'object' && option;

if (!data) {
var config = $.extend(Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, $this.data(), options);
var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults, $this.data(), options);
$this.data('selectpicker', (data = new Selectpicker(this, config, event)));
} else if (options) {
for (var i in options) {
Expand Down
Loading

0 comments on commit a1db054

Please sign in to comment.