Skip to content

Commit

Permalink
Implemented the noConflict API. Fixes #671
Browse files Browse the repository at this point in the history
  • Loading branch information
t0xicCode committed Aug 14, 2014
1 parent e7c7286 commit 4a30a5b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
15 changes: 13 additions & 2 deletions dist/js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,9 @@
}
};

$.fn.selectpicker = function (option, event) {
// SELECTPICKER PLUGIN DEFINITION
// ==========================
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
Expand Down Expand Up @@ -1020,10 +1022,19 @@
} else {
return chain;
}
};
}

var old = $.fn.selectpicker;
$.fn.selectpicker = Plugin;
$.fn.selectpicker.Constructor = Selectpicker;

// SELECTPICKER NO CONFLICT
// ====================
$.fn.selectpicker.noConflict = function () {
$.fn.selectpicker = old;
return this;
};

$(document)
.data('keycount', 0)
.on('keydown', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bootstrap-select-searchbox input', Selectpicker.prototype.keydown)
Expand Down
Loading

0 comments on commit 4a30a5b

Please sign in to comment.