Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit a208320

Browse files
committed
Remove extra commits by hand due to recent merge
1 parent 4559b4b commit a208320

File tree

4 files changed

+26
-77
lines changed

4 files changed

+26
-77
lines changed

.gitignore

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
/bower_components/
2-
/tools
3-
*.name
4-
.idea/encodings.xml
5-
*.xml
6-
.idea/multiple-select.iml
2+
/tools

docs/README.md

+17-50
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ Custom the item style.
891891

892892
### The Refresh
893893

894-
Reloads the Multiple Select.
894+
Reloads the Multiple Select.
895895
If you're dynamically adding/removing option tags on the original select via AJAX or DOM manipulation methods, call refresh to reflect the changes.
896896

897897
<p>
@@ -956,7 +956,7 @@ If you're dynamically adding/removing option tags on the original select via AJA
956956

957957
### The Destroy
958958

959-
Destroy the Multiple Select.
959+
Destroy the Multiple Select.
960960

961961
If you want remove the multiple select properly.
962962

@@ -1076,90 +1076,57 @@ $('select').multipleSelect('destroy');
10761076
var values = $.map(view.children, function(child){
10771077
return child.value;
10781078
}).join(', ');
1079-
$eventResult.text('Optgroup ' + view.label + ' ' +
1079+
$eventResult.text('Optgroup ' + view.label + ' ' +
10801080
(view.checked ? 'checked' : 'unchecked') + ': ' + values);
10811081
},
10821082
onClick: function(view) {
1083-
$eventResult.text(view.label + '(' + view.value + ') ' +
1083+
$eventResult.text(view.label + '(' + view.value + ') ' +
10841084
(view.checked ? 'checked' : 'unchecked'));
10851085
}
10861086
});
10871087
</script>
10881088
</body>
10891089
```
10901090

1091-
### OpenOnHover
1092-
1093-
<p id="e22">
1094-
<select class="w300" multiple="multiple">
1095-
<option value="1">Monday</option>
1096-
<option value="2">Tuesday</option>
1097-
<option value="3">Wednesday</option>
1098-
<option value="4">Thursday</option>
1099-
<option value="5">Friday</option>
1100-
<option value="6">Saturday</option>
1101-
<option value="7">Sunday</option>
1102-
</select>
1103-
</p>
1104-
1105-
``` html
1106-
<head>
1107-
<link href="multiple-select.css" rel="stylesheet"/>
1108-
</head>
1109-
<body>
1110-
<select multiple="multiple">
1111-
<option value="1">Monday</option>
1112-
...
1113-
<option value="7">Sunday</option>
1114-
</select>
1115-
<script src="multiple-select.js"></script>
1116-
<script>
1117-
$("select").multipleSelect({
1118-
openOnHover: true
1119-
});
1120-
</script>
1121-
</body>
1122-
```
1123-
11241091
## Documentation
11251092

11261093
### Constructor
11271094

11281095
#### isOpen
11291096

1130-
Type: boolean
1097+
Type: boolean
11311098

11321099
Whether or not Multiple Select open the select dropdown.
11331100

11341101
By default this option is set to ```false```.
11351102

11361103
#### placeholder
11371104

1138-
Type: string
1105+
Type: string
11391106

11401107
A placeholder value can be defined and will be displayed until you select a item.
11411108

11421109
By default this option is set to ```''```.
11431110

11441111
#### selectAll
11451112

1146-
Type: boolean
1113+
Type: boolean
11471114

11481115
Whether or not Multiple Select show select all checkbox.
11491116

11501117
By default this option is set to ```true```.
11511118

11521119
#### selectAllText
11531120

1154-
Type: string
1121+
Type: string
11551122

11561123
Multiple Select select all checkbox text.
11571124

11581125
By default this option is set to ```Select all```.
11591126

11601127
#### selectAllDelimiter
11611128

1162-
Type: Array
1129+
Type: Array
11631130

11641131
Multiple Select select all checkbox delimiter.
11651132

@@ -1199,15 +1166,15 @@ By default this option is set to ```false```.
11991166

12001167
#### multiple
12011168

1202-
Type: boolean
1169+
Type: boolean
12031170

12041171
Whether or not Multiple Select show multiple items in a row.
12051172

12061173
By default this option is set to ```false```.
12071174

12081175
#### multipleWidth
12091176

1210-
Type: integer
1177+
Type: integer
12111178

12121179
Multiple Select show multiple items width.
12131180

@@ -1302,7 +1269,7 @@ Bind an event handler to the "blur"
13021269

13031270
#### onOptgroupClick
13041271

1305-
Fires when a an optgroup label is clicked on.
1272+
Fires when a an optgroup label is clicked on.
13061273

13071274
```javascript
13081275
onOptgroupClick: function(view) {
@@ -1316,7 +1283,7 @@ onOptgroupClick: function(view) {
13161283

13171284
#### onClick
13181285

1319-
Fires when a checkbox is checked or unchecked.
1286+
Fires when a checkbox is checked or unchecked.
13201287

13211288
```javascript
13221289
onClick: function(view) {
@@ -1336,7 +1303,7 @@ Gets the selected values.
13361303
Parameter: type
13371304

13381305
Type: string
1339-
1306+
13401307
The type of selected items. value or text
13411308

13421309
The default is ```value```.
@@ -1353,7 +1320,7 @@ Sets the selected values.
13531320
Parameter: values
13541321

13551322
Type: array
1356-
1323+
13571324
The values of selected items.
13581325

13591326
``` javascript
@@ -1410,7 +1377,7 @@ $('select').multipleSelect('blur');
14101377

14111378
#### refresh
14121379

1413-
Reloads the Multiple Select.
1380+
Reloads the Multiple Select.
14141381

14151382
If you're dynamically adding/removing option tags on the original select via AJAX or DOM manipulation methods, call refresh to reflect the changes.
14161383

@@ -1420,7 +1387,7 @@ $('select').multipleSelect('refresh');
14201387

14211388
#### destroy
14221389

1423-
Destroy the Multiple Select.
1390+
Destroy the Multiple Select.
14241391

14251392
If you want remove the multiple select properly.
14261393

docs/js/index.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $(function() {
2727
$('#e9').find('select').multipleSelect({
2828
selectAll: false
2929
});
30-
30+
3131
$('#e10, #e11, #e12, #e13, #e19').find('select').multipleSelect();
3232
$('#setSelectsBtn').click(function() {
3333
$('#e10').find('select').multipleSelect('setSelects', [1, 3]);
@@ -134,9 +134,5 @@ $(function() {
134134
isOpen: true,
135135
keepOpen: true
136136
});
137-
138-
$('#e22').find('select').multipleSelect({
139-
openOnHover: true
140-
});
141137
});
142-
});
138+
});

multiple-select.js

+6-16
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,12 @@
219219
].join(''));
220220
}
221221

222+
var elems = [];
222223
$.each(this.$el.children(), function (i, elm) {
223-
$ul.append(that.optionToHtml(i, elm));
224+
elems.push(that.optionToHtml(i, elm));
224225
});
226+
$ul.append(elems);
227+
225228
$ul.append(sprintf('<li class="ms-no-results">%s</li>', this.options.noMatchesFound));
226229
this.$drop.append($ul);
227230

@@ -243,12 +246,6 @@
243246
if (this.options.isOpen) {
244247
this.open();
245248
}
246-
247-
if (this.options.openOnHover) {
248-
$(".ms-parent").hover(function (e) {
249-
that.open();
250-
});
251-
}
252249
},
253250

254251
optionToHtml: function (i, elm, group, groupDisabled) {
@@ -613,12 +610,6 @@
613610
this.$choice.addClass('disabled');
614611
},
615612

616-
destroy: function () {
617-
this.$el.show();
618-
this.$parent.remove();
619-
delete $.fn.multipleSelect;
620-
},
621-
622613
checkAll: function () {
623614
this.$selectItems.prop('checked', true);
624615
this.$selectGroups.prop('checked', true);
@@ -649,11 +640,11 @@
649640
this.init();
650641
},
651642

652-
destroy: function () {
643+
destroy: function () {
653644
this.$el.show();
654645
this.$parent.remove();
655646
this.$el.data('multipleSelect', null);
656-
},
647+
},
657648

658649
filter: function () {
659650
var that = this,
@@ -769,7 +760,6 @@
769760
addTitle: false,
770761
filterAcceptOnEnter: false,
771762
hideOptgroupCheckboxes: false,
772-
openOnHover: false,
773763

774764
selectAllText: 'Select all',
775765
allSelected: 'All selected',

0 commit comments

Comments
 (0)