Commit 166d383f authored by David Stutz's avatar David Stutz
parents d0bb6dc2 c23484dd
......@@ -2,7 +2,7 @@
"name": "bootstrap-multiselect",
"description": "Twitter Bootstrap plugin to make selects user friendly.",
"homepage": "http://davidstutz.github.io/bootstrap-multiselect/",
"version": "0.9.13",
"version": "0.9.14",
"keywords": [
"js",
"css",
......
......@@ -151,7 +151,7 @@
this.originalOptions = this.$select.clone()[0].options;
this.query = '';
this.searchTimeout = null;
this.lastToggledInput = null
this.lastToggledInput = null;
this.options.multiple = this.$select.attr('multiple') === "multiple";
this.options.onChange = $.proxy(this.options.onChange, this);
......@@ -159,6 +159,7 @@
this.options.onDropdownHide = $.proxy(this.options.onDropdownHide, this);
this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this);
this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this);
this.options.onInitialized = $.proxy(this.options.onInitialized, this);
// Build select all if enabled.
this.buildContainer();
......@@ -176,6 +177,8 @@
}
this.$select.hide().after(this.$container);
this.options.onInitialized(this.$select, this.$container);
};
Multiselect.prototype = {
......@@ -309,6 +312,15 @@
*/
onSelectAll: function() {
},
/**
* Triggered after initializing.
*
* @param {jQuery} $select
* @param {jQuery} $container
*/
onInitialized: function($select, $container) {
},
enableHTML: false,
buttonClass: 'btn btn-default',
......
......@@ -13,7 +13,7 @@
<script type="text/javascript" src="lib/jasmine-2.0.2/boot.js"></script>
<script type="text/javascript" src="../docs/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="../docs/js/bootstrap-3.2.0.min.js"></script>
<script type="text/javascript" src="../docs/js/bootstrap-3.3.2.min.js"></script>
<script type="text/javascript" src="../dist/js/bootstrap-multiselect.js"></script>
<script type="text/javascript" src="spec/bootstrap-multiselect.js"></script>
......
describe('Bootstrap Multiselect "Core".', function() {
var onInitialized = false;
beforeEach(function() {
var $select = $('<select id="multiselect" multiple="multiple"></select>');
......@@ -15,7 +17,10 @@ describe('Bootstrap Multiselect "Core".', function() {
$('body').append($select);
$select.multiselect({
buttonContainer: '<div id="multiselect-container"></div>'
buttonContainer: '<div id="multiselect-container"></div>',
onInitialized: function($select) {
onInitialized = true;
}
});
});
......@@ -197,7 +202,11 @@ describe('Bootstrap Multiselect "Core".', function() {
expect($('#multiselect-container input[value="10"]').prop('checked')).toBe(false);
expect($('#multiselect option[value="10"]').prop('selected')).toBe(false);
});
it('Should trigger onInitialized.', function() {
expect(onInitialized).toBe(true);
});
afterEach(function() {
$('#multiselect').multiselect('destroy');
$('#multiselect').remove();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment