Commit 15f803df authored by George Kats's avatar George Kats

Provide ability to add divider to menu.

parent e61e25be
......@@ -143,6 +143,7 @@
ul: '<ul class="multiselect-container dropdown-menu"></ul>',
filter: '<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div>',
li: '<li><a href="javascript:void(0);"><label></label></a></li>',
divider: '<li class="divider"></li>',
liGroup: '<li><label class="multiselect-group"></label></li>'
},
......@@ -217,8 +218,15 @@
this.createOptgroup(element);
}
else if (tag === 'option') {
if ($(element).data('role') === 'divider') {
this.createDivider();
}
else {
this.createOptionValue(element);
}
}
// Other illegal tags will be ignored.
}, this));
......@@ -429,6 +437,12 @@
}
},
// Create divider
createDivider: function(element) {
var $divider = $(this.templates.divider);
this.$ul.append($divider);
},
// Create optgroup.
createOptgroup: function(group) {
var groupName = $(group).prop('label');
......
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