|
152 | 152 | init: function () { |
153 | 153 | this.numSelected = 0; |
154 | 154 | this.valMap = null; |
155 | | - this.bulkMode = false; |
156 | 155 | this.config = $.extend(true, {}, this.defaults, this.options, this.metadata); |
157 | 156 |
|
158 | 157 | var originalName = this._getNameAttribute(), |
|
1052 | 1051 | this.numSelected = 1 + this.numSelected; |
1053 | 1052 |
|
1054 | 1053 | if (this.config.maxShow !== 0 && this.numSelected > this.config.maxShow) { |
1055 | | - if (!this.bulkMode) { |
| 1054 | + if (this.valMap == null) { |
1056 | 1055 | this._setXItemsSelected(); |
1057 | 1056 | } |
1058 | 1057 | } else { |
|
1110 | 1109 | $myDisplayItem.remove(); |
1111 | 1110 | solOptionItem.displaySelectionItem = undefined; |
1112 | 1111 | } |
1113 | | - if (!this.bulkMode) { |
| 1112 | + if (this.valMap == null) { |
1114 | 1113 | this._setXItemsSelected(); |
1115 | 1114 | } |
1116 | 1115 | }, |
|
1199 | 1198 | selectAll: function (/* string or undefined */optgroup) { |
1200 | 1199 | if (this.config.multiple) { |
1201 | 1200 | this._buildValMap(); |
1202 | | - this.bulkMode = true; |
1203 | 1201 |
|
1204 | 1202 | var $changedInputs = !optgroup ? this.$selectionContainer |
1205 | 1203 | : this.$selectionContainer |
|
1218 | 1216 | this.config.events.onChange.call(this, this, $changedInputs); |
1219 | 1217 | } |
1220 | 1218 |
|
1221 | | - this.bulkMode = false; |
1222 | 1219 | this.valMap = null; |
1223 | 1220 | this._setXItemsSelected(); |
1224 | 1221 | } |
|
1229 | 1226 | invert: function () { |
1230 | 1227 | if (this.config.multiple) { |
1231 | 1228 | this._buildValMap(); |
1232 | | - this.bulkMode = true; |
1233 | 1229 |
|
1234 | 1230 | var $closedInputs = this.$selectionContainer |
1235 | 1231 | .find('input[type="checkbox"][name=project]:not([disabled], :checked)') |
|
1247 | 1243 | this.config.events.onChange.call(this, this, $openedInputs.add($closedInputs)); |
1248 | 1244 | } |
1249 | 1245 |
|
1250 | | - this.bulkMode = false; |
1251 | 1246 | this.valMap = null; |
1252 | 1247 | this._setXItemsSelected(); |
1253 | 1248 | } |
|
1258 | 1253 | deselectAll: function ( /* string or undefined */ optgroup) { |
1259 | 1254 | if (this.config.multiple) { |
1260 | 1255 | this._buildValMap(); |
1261 | | - this.bulkMode = true; |
1262 | 1256 |
|
1263 | 1257 | var $changedInputs = !optgroup ? this.$selectionContainer |
1264 | 1258 | : this.$selectionContainer |
|
1277 | 1271 | this.config.events.onChange.call(this, this, $changedInputs); |
1278 | 1272 | } |
1279 | 1273 |
|
1280 | | - this.bulkMode = false; |
1281 | 1274 | this.valMap = null; |
1282 | 1275 | this._setXItemsSelected(); |
1283 | 1276 | } |
|
0 commit comments