From f963eb0bdde5b59c6e02d0a166c85c50b080bade Mon Sep 17 00:00:00 2001 From: Vinicius Fagundes Date: Wed, 11 Jun 2014 21:34:25 -0300 Subject: [PATCH 1/5] Fixed #322 --- css/bootstrap-multiselect.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/bootstrap-multiselect.css b/css/bootstrap-multiselect.css index 4d8bd5c8..670dcb07 100644 --- a/css/bootstrap-multiselect.css +++ b/css/bootstrap-multiselect.css @@ -1 +1 @@ -.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px} \ No newline at end of file +.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.form-inline .multiselect-container label.checkbox,.form-inline .multiselect-container label.radio{padding: 3px 20px 3px 40px}.form-inline .multiselect-container li a label.checkbox input[type=checkbox],.form-inline .multiselect-container li a label.radio input[type=radio]{margin-left: -20px;margin-right: 0px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px} \ No newline at end of file From bdd549fdee1425b435c1e5e2aa5ae132cb2819ca Mon Sep 17 00:00:00 2001 From: ellauty Date: Tue, 8 Jul 2014 12:06:39 -0300 Subject: [PATCH 2/5] Update bootstrap-multiselect.js --- js/bootstrap-multiselect.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/bootstrap-multiselect.js b/js/bootstrap-multiselect.js index f583e5ff..e6b27ff9 100644 --- a/js/bootstrap-multiselect.js +++ b/js/bootstrap-multiselect.js @@ -262,6 +262,9 @@ this.$button.css({ 'width' : this.options.buttonWidth }); + this.$container.css({ + 'width': this.options.buttonWidth + }); } // Keep the tab index from the select. From 3e96c7e0b51ca4b0e5ce64deb3090333380dd537 Mon Sep 17 00:00:00 2001 From: goncons Date: Wed, 9 Jul 2014 20:03:19 -0430 Subject: [PATCH 3/5] Little correction to dataprovider. There is a little correction to the method dataprovider, the parameters for the callback function are index, value. Probably the problem is that in the forEach method of an array this two parameters are inverted. --- js/bootstrap-multiselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-multiselect.js b/js/bootstrap-multiselect.js index f583e5ff..b80cb3f7 100644 --- a/js/bootstrap-multiselect.js +++ b/js/bootstrap-multiselect.js @@ -894,7 +894,7 @@ var optionDOM = ""; var groupCounter = 0; - $.each(dataprovider, function (option) { + $.each(dataprovider, function (index, option) { if ($.isArray(option.children)) { groupCounter++; optionDOM += ''; From 1782cb98b1b6717b63fd0d46939fd0b7604309f2 Mon Sep 17 00:00:00 2001 From: Nicholas Nieslanik Date: Fri, 11 Jul 2014 08:47:12 -0600 Subject: [PATCH 4/5] Fixing the initialization of the selected items in the multi-select for Knockout.js binding integration. Currently a persisted binding value isn't being initialized correctly when using KO. Instead the selectedOptions are only being set on during the update binding function or when the observableArray is changed. With this fix, if the observableArray has initial values, they are selected as necessary.s --- js/bootstrap-multiselect.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/bootstrap-multiselect.js b/js/bootstrap-multiselect.js index f583e5ff..d075ba32 100644 --- a/js/bootstrap-multiselect.js +++ b/js/bootstrap-multiselect.js @@ -30,6 +30,8 @@ $(element).multiselect(config); if (isObservableArray(listOfSelectedItems)) { + //set the initial selection state on the multi-select list + $(element).multiselect('select', ko.utils.unwrapObservable(listOfSelectedItems)); // Subscribe to the selectedOptions: ko.observableArray listOfSelectedItems.subscribe(function (changes) { var addedArray = [], deletedArray = []; From bbe1d91098104cbf69a0244e4ebcfa8c36085420 Mon Sep 17 00:00:00 2001 From: Vinicius Fagundes Date: Fri, 11 Jul 2014 15:29:55 -0300 Subject: [PATCH 5/5] Changing .less file --- css/bootstrap-multiselect.css | 2 +- less/bootstrap-multiselect.less | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/css/bootstrap-multiselect.css b/css/bootstrap-multiselect.css index 670dcb07..d982bd70 100644 --- a/css/bootstrap-multiselect.css +++ b/css/bootstrap-multiselect.css @@ -1 +1 @@ -.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.form-inline .multiselect-container label.checkbox,.form-inline .multiselect-container label.radio{padding: 3px 20px 3px 40px}.form-inline .multiselect-container li a label.checkbox input[type=checkbox],.form-inline .multiselect-container li a label.radio input[type=radio]{margin-left: -20px;margin-right: 0px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px} \ No newline at end of file +.multiselect-container{position:absolute;list-style-type:none;margin:0;padding:0}.multiselect-container .input-group{margin:5px}.multiselect-container>li{padding:0}.multiselect-container>li>a.multiselect-all label{font-weight:700}.multiselect-container>li>label.multiselect-group{margin:0;padding:3px 20px;height:100%;font-weight:700}.multiselect-container>li>a{padding:0}.multiselect-container>li>a>label{margin:0;height:100%;cursor:pointer;font-weight:400;padding:3px 20px 3px 40px}.multiselect-container>li>a>label.radio,.multiselect-container>li>a>label.checkbox{margin:0}.multiselect-container>li>a>label>input[type=checkbox]{margin-bottom:5px}.btn-group>.btn-group:nth-child(2)>.multiselect.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.form-inline .multiselect-container label.checkbox,.form-inline .multiselect-container label.radio{padding:3px 20px 3px 40px}.form-inline .multiselect-container li a label.checkbox input[type=checkbox],.form-inline .multiselect-container li a label.radio input[type=radio]{margin-left:-20px;margin-right:0} \ No newline at end of file diff --git a/less/bootstrap-multiselect.less b/less/bootstrap-multiselect.less index 6d2eb19c..6de104b2 100644 --- a/less/bootstrap-multiselect.less +++ b/less/bootstrap-multiselect.less @@ -58,3 +58,17 @@ border-bottom-left-radius: 4px; } +.form-inline .multiselect-container{ + + label.checkbox, label.radio{ + padding: 3px 20px 3px 40px; + } + + li a label{ + + &.checkbox input[type="checkbox"], &.radio input[type="radio"]{ + margin-left: -20px; + margin-right: 0; + } + } +}