Skip to content

Commit 9a9cada

Browse files
committed
Merge pull request #635 from ehynds/Issue595
Issue #595 can be closed.
2 parents 20f651a + 422b0f3 commit 9a9cada

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

src/jquery.multiselect.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,10 @@
637637
getChecked: function() {
638638
return this.menu.find('input').filter(':checked');
639639
},
640+
641+
getUnchecked: function() {
642+
return this.menu.find('input').not(':checked');
643+
},
640644

641645
destroy: function() {
642646
// remove classes + data

tests/unit/events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
equals(this, el[0], "option: context of callback");
143143
equals(e.type, 'multiselectclick', 'option: event type in callback');
144144
equals(ui.value, "2", "option: ui.value equals");
145-
equals(ui.text, "Option 2", "option: ui.title equals");
145+
equals(ui.text, "Option 2", "option: ui.text equals");
146146

147147
if(times === 0) {
148148
equals(ui.checked, true, "option: ui.checked equals");
@@ -155,7 +155,7 @@
155155
ok(true, 'event: triggering the click event on the second checkbox triggers multiselectclick');
156156
equals(this, el[0], 'event: context of event');
157157
equals(ui.value, "2", "event: ui.value equals");
158-
equals(ui.text, "Option 2", "event: ui.title equals");
158+
equals(ui.text, "Option 2", "event: ui.text equals");
159159

160160
if(times === 0) {
161161
equals(ui.checked, true, "option: ui.checked equals");

tests/unit/methods.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@
122122
equals( el.multiselect("getChecked").length, 0, 'number of checkboxes returned after unchecking all and calling getChecked');
123123
el.multiselect("destroy");
124124
});
125+
126+
test("getUnchecked", function(){
127+
expect(2);
128+
129+
el = $("select").multiselect().multiselect("checkAll");
130+
equals( el.multiselect("getUnchecked").length, 0, 'number of checkboxes returned after checking all and calling getUnchecked');
131+
el.multiselect("uncheckAll");
132+
equals( el.multiselect("getUnchecked").length, 9, 'number of checkboxes returned after unchecking all and calling getUnchecked');
133+
el.multiselect("destroy");
134+
});
125135

126136
test("refresh", function(){
127137
expect(4);

tests/unit/testSuite.html

Lines changed: 47 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)