Subversion Repositories SmartDukaan

Rev

Rev 23026 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23026 Rev 24909
Line 1... Line 1...
1
/**
1
/**
2
 * Bootstrap Multiselect (https://github.com/davidstutz/bootstrap-multiselect)
2
 * Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/)
3
 *
3
 *
4
 * Apache License, Version 2.0:
4
 * Apache License, Version 2.0:
5
 * Copyright (c) 2012 - 2015 David Stutz
5
 * Copyright (c) 2012 - 2018 David Stutz
6
 *
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8
 * use this file except in compliance with the License. You may obtain a
8
 * use this file except in compliance with the License. You may obtain a
9
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0
10
 *
10
 *
Line 13... Line 13...
13
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
 * License for the specific language governing permissions and limitations
14
 * License for the specific language governing permissions and limitations
15
 * under the License.
15
 * under the License.
16
 *
16
 *
17
 * BSD 3-Clause License:
17
 * BSD 3-Clause License:
18
 * Copyright (c) 2012 - 2015 David Stutz
18
 * Copyright (c) 2012 - 2018 David Stutz
19
 * All rights reserved.
19
 * All rights reserved.
20
 *
20
 *
21
 * Redistribution and use in source and binary forms, with or without
21
 * Redistribution and use in source and binary forms, with or without
22
 * modification, are permitted provided that the following conditions are met:
22
 * modification, are permitted provided that the following conditions are met:
23
 *    - Redistributions of source code must retain the above copyright notice,
23
 *    - Redistributions of source code must retain the above copyright notice,
Line 39... Line 39...
39
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
40
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
41
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
42
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43
 */
43
 */
-
 
44
(function (root, factory) {
-
 
45
    // check to see if 'knockout' AMD module is specified if using requirejs
-
 
46
    if (typeof define === 'function' && define.amd &&
-
 
47
        typeof require === 'function' && typeof require.specified === 'function' && require.specified('knockout')) {
-
 
48
 
-
 
49
        // AMD. Register as an anonymous module.
-
 
50
        define(['jquery', 'knockout'], factory);
-
 
51
    } else {
-
 
52
        // Browser globals
-
 
53
        factory(root.jQuery, root.ko);
-
 
54
    }
44
!function ($) {
55
})(this, function ($, ko) {
45
    "use strict";// jshint ;_;
56
    "use strict";// jshint ;_;
46
 
57
 
47
    if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) {
58
    if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) {
48
        ko.bindingHandlers.multiselect = {
59
        ko.bindingHandlers.multiselect = {
49
            after: ['options', 'value', 'selectedOptions', 'enable', 'disable'],
60
            after: ['options', 'value', 'selectedOptions', 'enable', 'disable'],
Line 202... Line 213...
202
 
213
 
203
        // Build select all if enabled.
214
        // Build select all if enabled.
204
        this.buildContainer();
215
        this.buildContainer();
205
        this.buildButton();
216
        this.buildButton();
206
        this.buildDropdown();
217
        this.buildDropdown();
-
 
218
        this.buildReset();
207
        this.buildSelectAll();
219
        this.buildSelectAll();
208
        this.buildDropdownOptions();
220
        this.buildDropdownOptions();
209
        this.buildFilter();
221
        this.buildFilter();
210
 
222
 
211
        this.updateButtonText();
223
        this.updateButtonText();
Line 255... Line 267...
255
                    }
267
                    }
256
                    else {
268
                    else {
257
                        return this.allSelectedText;
269
                        return this.allSelectedText;
258
                    }
270
                    }
259
                }
271
                }
260
                else if (options.length > this.numberDisplayed) {
272
                else if (this.numberDisplayed != 0 && options.length > this.numberDisplayed) {
261
                    return options.length + ' ' + this.nSelectedText;
273
                    return options.length + ' ' + this.nSelectedText;
262
                }
274
                }
263
                else {
275
                else {
264
                    var selected = '';
276
                    var selected = '';
265
                    var delimiter = this.delimiterText;
277
                    var delimiter = this.delimiterText;
Line 408... Line 420...
408
            enableFiltering: false,
420
            enableFiltering: false,
409
            enableCaseInsensitiveFiltering: false,
421
            enableCaseInsensitiveFiltering: false,
410
            enableFullValueFiltering: false,
422
            enableFullValueFiltering: false,
411
            enableClickableOptGroups: false,
423
            enableClickableOptGroups: false,
412
            enableCollapsibleOptGroups: false,
424
            enableCollapsibleOptGroups: false,
-
 
425
            collapseOptGroupsByDefault: false,
413
            filterPlaceholder: 'Search',
426
            filterPlaceholder: 'Search',
414
            // possible options: 'text', 'value', 'both'
427
            // possible options: 'text', 'value', 'both'
415
            filterBehavior: 'text',
428
            filterBehavior: 'text',
416
            includeFilterClearBtn: true,
429
            includeFilterClearBtn: true,
417
            preventInputChangeEvent: false,
430
            preventInputChangeEvent: false,
Line 420... Line 433...
420
            allSelectedText: 'All selected',
433
            allSelectedText: 'All selected',
421
            numberDisplayed: 3,
434
            numberDisplayed: 3,
422
            disableIfEmpty: false,
435
            disableIfEmpty: false,
423
            disabledText: '',
436
            disabledText: '',
424
            delimiterText: ', ',
437
            delimiterText: ', ',
-
 
438
            includeResetOption: false,
-
 
439
            includeResetDivider: false,
-
 
440
            resetText: 'Reset',
425
            templates: {
441
            templates: {
426
                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>',
442
                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>',
427
                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
443
                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
428
                filter: '<li class="multiselect-item multiselect-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>',
444
                filter: '<li class="multiselect-item multiselect-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>',
429
                filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',
445
                filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',
430
                li: '<li><a tabindex="0"><label></label></a></li>',
446
                li: '<li><a tabindex="0"><label></label></a></li>',
431
                divider: '<li class="multiselect-item divider"></li>',
447
                divider: '<li class="multiselect-item divider"></li>',
432
                liGroup: '<li class="multiselect-item multiselect-group"><label></label></li>'
448
                liGroup: '<li class="multiselect-item multiselect-group"><label></label></li>',
-
 
449
                resetButton: '<li class="multiselect-reset text-center"><div class="input-group"><a class="btn btn-default btn-block"></a></div></li>'
433
            }
450
            }
434
        },
451
        },
435
 
452
 
436
        constructor: Multiselect,
453
        constructor: Multiselect,
437
 
454
 
Line 555... Line 572...
555
 
572
 
556
                // Other illegal tags will be ignored.
573
                // Other illegal tags will be ignored.
557
            }, this));
574
            }, this));
558
 
575
 
559
            // Bind the change event on the dropdown elements.
576
            // Bind the change event on the dropdown elements.
-
 
577
            $(this.$ul).off('change', 'li:not(.multiselect-group) input[type="checkbox"], li:not(.multiselect-group) input[type="radio"]');
560
            $('li:not(.multiselect-group) input', this.$ul).on('change', $.proxy(function(event) {
578
            $(this.$ul).on('change', 'li:not(.multiselect-group) input[type="checkbox"], li:not(.multiselect-group) input[type="radio"]', $.proxy(function(event) {
561
                var $target = $(event.target);
579
                var $target = $(event.target);
562
 
580
 
563
                var checked = $target.prop('checked') || false;
581
                var checked = $target.prop('checked') || false;
564
                var isSelectAllOption = $target.val() === this.options.selectAllValue;
582
                var isSelectAllOption = $target.val() === this.options.selectAllValue;
565
 
583
 
Line 645... Line 663...
645
                    // Prevent selecting text by Shift+click
663
                    // Prevent selecting text by Shift+click
646
                    return false;
664
                    return false;
647
                }
665
                }
648
            });
666
            });
649
 
667
 
650
            $('li a', this.$ul).on('touchstart click', $.proxy(function(event) {
668
            $(this.$ul).on('touchstart click', 'li a', $.proxy(function(event) {
651
                event.stopPropagation();
669
                event.stopPropagation();
652
 
670
 
653
                var $target = $(event.target);
671
                var $target = $(event.target);
654
 
672
 
655
                if (event.shiftKey && this.options.multiple) {
673
                if (event.shiftKey && this.options.multiple) {
Line 659... Line 677...
659
                        $target.prop("checked", !$target.prop("checked"));
677
                        $target.prop("checked", !$target.prop("checked"));
660
                    }
678
                    }
661
                    var checked = $target.prop('checked') || false;
679
                    var checked = $target.prop('checked') || false;
662
 
680
 
663
                    if (this.lastToggledInput !== null && this.lastToggledInput !== $target) { // Make sure we actually have a range
681
                    if (this.lastToggledInput !== null && this.lastToggledInput !== $target) { // Make sure we actually have a range
664
                        var from = $target.closest("li").index();
682
                        var from = this.$ul.find("li:visible").index($target.parents("li"));
665
                        var to = this.lastToggledInput.closest("li").index();
683
                        var to = this.$ul.find("li:visible").index(this.lastToggledInput.parents("li"));
666
 
684
 
667
                        if (from > to) { // Swap the indices
685
                        if (from > to) { // Swap the indices
668
                            var tmp = to;
686
                            var tmp = to;
669
                            to = from;
687
                            to = from;
670
                            from = tmp;
688
                            from = tmp;
Line 672... Line 690...
672
 
690
 
673
                        // Make sure we grab all elements since slice excludes the last index
691
                        // Make sure we grab all elements since slice excludes the last index
674
                        ++to;
692
                        ++to;
675
 
693
 
676
                        // Change the checkboxes and underlying options
694
                        // Change the checkboxes and underlying options
677
                        var range = this.$ul.find("li").slice(from, to).find("input");
695
                        var range = this.$ul.find("li").not(".multiselect-filter-hidden").slice(from, to).find("input");
678
 
696
 
679
                        range.prop('checked', checked);
697
                        range.prop('checked', checked);
680
 
698
 
681
                        if (this.options.selectedClass) {
699
                        if (this.options.selectedClass) {
682
                            range.closest('li')
700
                            range.closest('li')
Line 719... Line 737...
719
                    if (!$items.length) {
737
                    if (!$items.length) {
720
                        return;
738
                        return;
721
                    }
739
                    }
722
 
740
 
723
                    var index = $items.index($items.filter(':focus'));
741
                    var index = $items.index($items.filter(':focus'));
724
 
-
 
-
 
742
                    
725
                    // Navigation up.
743
                    // Navigation up.
726
                    if (event.keyCode === 38 && index > 0) {
744
                    if (event.keyCode === 38 && index > 0) {
727
                        index--;
745
                        index--;
728
                    }
746
                    }
729
                    // Navigate down.
747
                    // Navigate down.
Line 799... Line 817...
799
 
817
 
800
                    // Cannot use select or deselect here because it would call updateOptGroups again.
818
                    // Cannot use select or deselect here because it would call updateOptGroups again.
801
 
819
 
802
                    this.options.onChange($options, checked);
820
                    this.options.onChange($options, checked);
803
 
821
 
-
 
822
                    this.$select.change();
804
                    this.updateButtonText();
823
                    this.updateButtonText();
805
                    this.updateSelectAll();
824
                    this.updateSelectAll();
806
                }, this));
825
                }, this));
807
            }
826
            }
808
 
827
 
Line 812... Line 831...
812
                    var $inputs = $li.nextUntil("li.multiselect-group")
831
                    var $inputs = $li.nextUntil("li.multiselect-group")
813
                            .not('.multiselect-filter-hidden');
832
                            .not('.multiselect-filter-hidden');
814
 
833
 
815
                    var visible = true;
834
                    var visible = true;
816
                    $inputs.each(function() {
835
                    $inputs.each(function() {
817
                        visible = visible && $(this).is(':visible');
836
                        visible = visible && !$(this).hasClass('multiselect-collapsible-hidden');
818
                    });
837
                    });
819
 
838
 
820
                    if (visible) {
839
                    if (visible) {
821
                        $inputs.hide()
840
                        $inputs.hide()
822
                            .addClass('multiselect-collapsible-hidden');
841
                            .addClass('multiselect-collapsible-hidden');
Line 851... Line 870...
851
            var inputType = this.options.multiple ? "checkbox" : "radio";
870
            var inputType = this.options.multiple ? "checkbox" : "radio";
852
 
871
 
853
            var $li = $(this.options.templates.li);
872
            var $li = $(this.options.templates.li);
854
            var $label = $('label', $li);
873
            var $label = $('label', $li);
855
            $label.addClass(inputType);
874
            $label.addClass(inputType);
-
 
875
            $label.attr("title", label);
856
            $li.addClass(classes);
876
            $li.addClass(classes);
857
 
877
 
-
 
878
            // Hide all children items when collapseOptGroupsByDefault is true
-
 
879
            if (this.options.collapseOptGroupsByDefault && $(element).parent().prop("tagName").toLowerCase() === "optgroup") {
-
 
880
                $li.addClass("multiselect-collapsible-hidden");
-
 
881
                $li.hide();
-
 
882
            }
-
 
883
 
858
            if (this.options.enableHTML) {
884
            if (this.options.enableHTML) {
859
                $label.html(" " + label);
885
                $label.html(" " + label);
860
            }
886
            }
861
            else {
887
            else {
862
                $label.text(" " + label);
888
                $label.text(" " + label);
Line 949... Line 975...
949
                this.createOptionValue(group);
975
                this.createOptionValue(group);
950
            }, this))
976
            }, this))
951
        },
977
        },
952
 
978
 
953
        /**
979
        /**
-
 
980
         * Build the reset.
-
 
981
         *
-
 
982
         */
-
 
983
        buildReset: function() {
-
 
984
            if (this.options.includeResetOption) {
-
 
985
 
-
 
986
                // Check whether to add a divider after the reset.
-
 
987
                if (this.options.includeResetDivider) {
-
 
988
                    this.$ul.prepend($(this.options.templates.divider));
-
 
989
                }
-
 
990
 
-
 
991
                var $resetButton = $(this.options.templates.resetButton);
-
 
992
 
-
 
993
                if (this.options.enableHTML) {
-
 
994
                    $('a', $resetButton).html(this.options.resetText);
-
 
995
                }
-
 
996
                else {
-
 
997
                    $('a', $resetButton).text(this.options.resetText);
-
 
998
                }
-
 
999
 
-
 
1000
                $('a', $resetButton).click($.proxy(function(){
-
 
1001
                    this.clearSelection();
-
 
1002
                }, this));
-
 
1003
 
-
 
1004
                this.$ul.prepend($resetButton);
-
 
1005
            }
-
 
1006
        },
-
 
1007
 
-
 
1008
        /**
954
         * Build the select all.
1009
         * Build the select all.
955
         *
1010
         *
956
         * Checks if a select all has already been created.
1011
         * Checks if a select all has already been created.
957
         */
1012
         */
958
        buildSelectAll: function() {
1013
        buildSelectAll: function() {
Line 1018... Line 1073...
1018
                    if(this.options.includeFilterClearBtn) {
1073
                    if(this.options.includeFilterClearBtn) {
1019
                        var clearBtn = $(this.options.templates.filterClearBtn);
1074
                        var clearBtn = $(this.options.templates.filterClearBtn);
1020
                        clearBtn.on('click', $.proxy(function(event){
1075
                        clearBtn.on('click', $.proxy(function(event){
1021
                            clearTimeout(this.searchTimeout);
1076
                            clearTimeout(this.searchTimeout);
1022
 
1077
 
-
 
1078
                            this.query = '';
1023
                            this.$filter.find('.multiselect-search').val('');
1079
                            this.$filter.find('.multiselect-search').val('');
1024
                            $('li', this.$ul).show().removeClass('multiselect-filter-hidden');
1080
                            $('li', this.$ul).show().removeClass('multiselect-filter-hidden');
1025
 
1081
 
1026
                            this.updateSelectAll();
1082
                            this.updateSelectAll();
1027
 
1083
 
Line 1087... Line 1143...
1087
                                        else if (filterCandidate.indexOf(this.query) > -1) {
1143
                                        else if (filterCandidate.indexOf(this.query) > -1) {
1088
                                            showElement = true;
1144
                                            showElement = true;
1089
                                        }
1145
                                        }
1090
 
1146
 
1091
                                        // Toggle current element (group or group item) according to showElement boolean.
1147
                                        // Toggle current element (group or group item) according to showElement boolean.
1092
                                        $(element).toggle(showElement)
1148
                                        if(!showElement){
-
 
1149
                                          $(element).css('display', 'none');
1093
                                            .toggleClass('multiselect-filter-hidden', !showElement);
1150
                                          $(element).addClass('multiselect-filter-hidden');
-
 
1151
                                        }
-
 
1152
                                        if(showElement){
-
 
1153
                                          $(element).css('display', 'block');
-
 
1154
                                          $(element).removeClass('multiselect-filter-hidden');
-
 
1155
                                        }
1094
 
1156
 
1095
                                        // Differentiate groups and group items.
1157
                                        // Differentiate groups and group items.
1096
                                        if ($(element).hasClass('multiselect-group')) {
1158
                                        if ($(element).hasClass('multiselect-group')) {
1097
                                            // Remember group status.
1159
                                            // Remember group status.
1098
                                            currentGroup = element;
1160
                                            currentGroup = element;
Line 1144... Line 1206...
1144
 
1206
 
1145
        /**
1207
        /**
1146
         * Refreshs the multiselect based on the selected options of the select.
1208
         * Refreshs the multiselect based on the selected options of the select.
1147
         */
1209
         */
1148
        refresh: function () {
1210
        refresh: function () {
-
 
1211
            var inputs = {};
-
 
1212
            $('li input', this.$ul).each(function() {
1149
            var inputs = $.map($('li input', this.$ul), $);
1213
              inputs[$(this).val()] = $(this);
-
 
1214
            });
1150
 
1215
 
1151
            $('option', this.$select).each($.proxy(function (index, element) {
1216
            $('option', this.$select).each($.proxy(function (index, element) {
1152
                var $elem = $(element);
1217
                var $elem = $(element);
1153
                var value = $elem.val();
1218
                var $input = inputs[$(element).val()];
1154
                var $input;
-
 
1155
                for (var i = inputs.length; 0 < i--; /**/) {
-
 
1156
                    if (value !== ($input = inputs[i]).val())
-
 
1157
                        continue; // wrong li
-
 
1158
 
1219
 
1159
                    if ($elem.is(':selected')) {
1220
                if ($elem.is(':selected')) {
1160
                        $input.prop('checked', true);
1221
                    $input.prop('checked', true);
1161
 
1222
 
1162
                        if (this.options.selectedClass) {
1223
                    if (this.options.selectedClass) {
1163
                            $input.closest('li')
1224
                        $input.closest('li')
1164
                                .addClass(this.options.selectedClass);
1225
                            .addClass(this.options.selectedClass);
1165
                        }
-
 
1166
                    }
1226
                    }
-
 
1227
                }
1167
                    else {
1228
                else {
1168
                        $input.prop('checked', false);
1229
                    $input.prop('checked', false);
1169
 
1230
 
1170
                        if (this.options.selectedClass) {
1231
                    if (this.options.selectedClass) {
1171
                            $input.closest('li')
1232
                        $input.closest('li')
1172
                                .removeClass(this.options.selectedClass);
1233
                            .removeClass(this.options.selectedClass);
1173
                        }
-
 
1174
                    }
1234
                    }
-
 
1235
                }
1175
 
1236
 
1176
                    if ($elem.is(":disabled")) {
1237
                if ($elem.is(":disabled")) {
1177
                        $input.attr('disabled', 'disabled')
1238
                    $input.attr('disabled', 'disabled')
1178
                            .prop('disabled', true)
1239
                        .prop('disabled', true)
1179
                            .closest('li')
1240
                        .closest('li')
1180
                            .addClass('disabled');
1241
                        .addClass('disabled');
1181
                    }
1242
                }
1182
                    else {
1243
                else {
1183
                        $input.prop('disabled', false)
1244
                    $input.prop('disabled', false)
1184
                            .closest('li')
1245
                        .closest('li')
1185
                            .removeClass('disabled');
1246
                        .removeClass('disabled');
1186
                    }
-
 
1187
                    break; // assumes unique values
-
 
1188
                }
1247
                }
1189
            }, this));
1248
            }, this));
1190
 
1249
 
1191
            this.updateButtonText();
1250
            this.updateButtonText();
1192
            this.updateSelectAll();
1251
            this.updateSelectAll();
Line 1450... Line 1509...
1450
                if ($.isArray(option.children)) { // create optiongroup tag
1509
                if ($.isArray(option.children)) { // create optiongroup tag
1451
                    groupCounter++;
1510
                    groupCounter++;
1452
 
1511
 
1453
                    $tag = $('<optgroup/>').attr({
1512
                    $tag = $('<optgroup/>').attr({
1454
                        label: option.label || 'Group ' + groupCounter,
1513
                        label: option.label || 'Group ' + groupCounter,
1455
                        disabled: !!option.disabled
1514
                        disabled: !!option.disabled,
-
 
1515
                        value: option.value
1456
                    });
1516
                    });
1457
 
1517
 
1458
                    forEach(option.children, function(subOption) { // add children option tags
1518
                    forEach(option.children, function(subOption) { // add children option tags
1459
                        var attributes = {
1519
                        var attributes = {
1460
                            value: subOption.value,
1520
                            value: subOption.value,
Line 1476... Line 1536...
1476
 
1536
 
1477
                    var attributes = {
1537
                    var attributes = {
1478
                        'value': option.value,
1538
                        'value': option.value,
1479
                        'label': option.label || option.value,
1539
                        'label': option.label || option.value,
1480
                        'title': option.title,
1540
                        'title': option.title,
1481
                        'class': option.class,
1541
                        'class': option['class'],
1482
                        'selected': !!option.selected,
1542
                        'selected': !!option['selected'],
1483
                        'disabled': !!option.disabled
1543
                        'disabled': !!option['disabled']
1484
                    };
1544
                    };
1485
                    //Loop through attributes object and add key-value for each attribute
1545
                    //Loop through attributes object and add key-value for each attribute
1486
                    for (var key in option.attributes) {
1546
                    for (var key in option.attributes) {
1487
                      attributes['data-' + key] = option.attributes[key];
1547
                      attributes['data-' + key] = option.attributes[key];
1488
                    }
1548
                    }
Line 1711... Line 1771...
1711
 
1771
 
1712
    $(function() {
1772
    $(function() {
1713
        $("select[data-role=multiselect]").multiselect();
1773
        $("select[data-role=multiselect]").multiselect();
1714
    });
1774
    });
1715
 
1775
 
1716
}(window.jQuery);
1776
});