Skip to content

Commit

Permalink
Merge pull request #926 from caseyjhol/master
Browse files Browse the repository at this point in the history
SelectAll/DeselectAll (Fix #721, Fix #901, fix #921)
  • Loading branch information
caseyjhol committed Feb 18, 2015
2 parents c621730 + 539400a commit c7b43c1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 28 deletions.
22 changes: 4 additions & 18 deletions dist/css/bootstrap-select.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-select.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-select.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions dist/js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
(null === this.options.liveSearchPlaceholder ? '' : ' placeholder="' + htmlEscape(this.options.liveSearchPlaceholder) + '"') + '>' +
'</div>'
: '';
var actionsbox = this.options.actionsBox ?
var actionsbox = this.multiple && this.options.actionsBox ?
'<div class="bs-actionsbox">' +
'<div class="btn-group btn-group-sm btn-block">' +
'<button class="actions-btn bs-select-all btn btn-default">' +
Expand All @@ -337,7 +337,8 @@
'</div>' +
'</div>'
: '';
var donebutton = this.multiple && this.options.doneButton ? '<div class="bs-donebutton">' +
var donebutton = this.multiple && this.options.doneButton ?
'<div class="bs-donebutton">' +
'<div class="btn-group btn-block">' +
'<button class="btn btn-sm btn-default">' +
this.options.doneButtonText +
Expand Down Expand Up @@ -1056,12 +1057,16 @@

selectAll: function () {
this.findLis();
this.$lis.not('.divider').not('.disabled').not('.selected').filter(':visible').find('a').click();
this.$element.find('option:enabled').not('[data-divider]').not('[data-hidden]').prop('selected', true);
this.$lis.not('.divider').not('.dropdown-header').not('.disabled').not('.hidden').addClass('selected');
this.render(false);
},

deselectAll: function () {
this.findLis();
this.$lis.not('.divider').not('.disabled').filter('.selected').filter(':visible').find('a').click();
this.$element.find('option:enabled').not('[data-divider]').not('[data-hidden]').prop('selected', false);
this.$lis.not('.divider').not('.dropdown-header').not('.disabled').not('.hidden').removeClass('selected');
this.render(false);
},

keydown: function (e) {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap-select.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/bootstrap-select.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,16 @@

selectAll: function () {
this.findLis();
this.$lis.not('.divider').not('.disabled').not('.selected').filter(':visible').find('a').click();
this.$element.find('option:enabled').not('[data-divider]').not('[data-hidden]').prop('selected', true);
this.$lis.not('.divider').not('.dropdown-header').not('.disabled').not('.hidden').addClass('selected');
this.render(false);
},

deselectAll: function () {
this.findLis();
this.$lis.not('.divider').not('.disabled').filter('.selected').filter(':visible').find('a').click();
this.$element.find('option:enabled').not('[data-divider]').not('[data-hidden]').prop('selected', false);
this.$lis.not('.divider').not('.dropdown-header').not('.disabled').not('.hidden').removeClass('selected');
this.render(false);
},

keydown: function (e) {
Expand Down

0 comments on commit c7b43c1

Please sign in to comment.