Skip to content

Commit 9837c2c

Browse files
SteveTheTechiemlh758
authored andcommitted
Peformance 3 and Dimensions (#735)
* Peformance 3 and Dimensions 1. Converted _makeOption to plain JS for speed. This is the last specific jQuery-to-plain-JS conversion that I am planning. 2. Added addInputNames option to allow opting out (false value) of creating name properties for inputs. These names sometimes duplicate what is already in use for the native select and just cause more inputs to be serialized and posted to the server than is needed. (slower) 3. Added caching of button width value, menu width value, menu height value, and positioned status and mechanisms to invalidate the cached status for each. The caching minimizes the recalculation of each of these values when the menu is successively opened. (Just calculated on first open and re-used.) 4. Re-wrote _setMenuHeight: - a. Implement a new "size" keyword for the menuHeight option that sets the menu height based on the number of rows specified in the native select's "size" attribute. If "size" is specified, but no attribute is found on the native select, a default size value of 4 rows is used like is the default for native multiple selects. - b. Also, _setMenuHeight is optimized to execute the least loop iterations to determine the appropriate menu height to use. - c. Lastly, the menu height is limited to the available window.innerHeight value. 5. Changed from using self.element.parent().outerWidth() to using self.element.parent().innerWidth() in _getMinWidth() to fix errors in % width calculations. 6. Tweaked the css file to remove unnecessary tag qualifications that degrade layout efficiency. 7. Tweaked the css file to replace descendent selectors with child selectors where possible for improved layout efficiency.
1 parent 406a6ba commit 9837c2c

File tree

3 files changed

+346
-291
lines changed

3 files changed

+346
-291
lines changed
File renamed without changes.

css/jquery.multiselect.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
.ui-multiselect { padding:2px 0 2px 4px; text-align:left }
2-
.ui-multiselect span.ui-icon { float:right }
2+
.ui-multiselect .ui-icon { float:right }
33
.ui-multiselect-single .ui-multiselect-checkboxes input { left:-9999px; position:absolute !important; top: auto !important; }
44
.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important }
55

66
.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px; }
7-
.ui-multiselect-header ul { font-size:0.9em }
8-
.ui-multiselect-header ul li { float:left; padding:0 10px 0 0; }
7+
.ui-multiselect-header > ul { font-size:0.9em }
8+
.ui-multiselect-header > ul > li { float:left; padding:0 10px 0 0; }
99
.ui-multiselect-header a { text-decoration:none; }
1010
.ui-multiselect-header a:hover { text-decoration:underline; cursor: pointer;}
11-
.ui-multiselect-header span.ui-icon { float:left; }
11+
.ui-multiselect-header .ui-icon { float:left; }
1212
.ui-multiselect-header .ui-multiselect-close { float:right; padding-right:0; text-align:right; }
1313

1414
.ui-multiselect-menu { display:none; padding:3px; position:absolute; text-align: left; }
1515
.ui-multiselect-checkboxes { overflow-y:auto; position:relative; }
1616
.ui-multiselect-checkboxes label { border:1px solid transparent; cursor:default; display:block; padding:3px 1px; }
17-
.ui-multiselect-checkboxes label input { position:relative; top:1px }
17+
.ui-multiselect-checkboxes label > input { position:relative; top:1px }
1818
.ui-multiselect-checkboxes label img { height: 30px; vertical-align: middle; padding-right: 3px;}
1919
.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; list-style: none; padding-right:3px; }
20-
.ui-multiselect-checkboxes .ui-multiselect-optgroup { padding: 3px; }
20+
.ui-multiselect-checkboxes > .ui-multiselect-optgroup { padding: 3px; }
2121
.ui-multiselect-columns { display: inline-block; vertical-align: top; }
22-
.ui-multiselect-checkboxes .ui-multiselect-optgroup a { border-bottom:1px solid; cursor: pointer; display:block; font-weight:bold; margin:1px 0; padding:3px; text-align:center; text-decoration:none; }
22+
.ui-multiselect-checkboxes > .ui-multiselect-optgroup > a { border-bottom:1px solid; cursor: pointer; display:block; font-weight:bold; margin:1px 0; padding:3px; text-align:center; text-decoration:none; }
2323

2424
@media print{
2525
.ui-multiselect-menu {display: none;}

0 commit comments

Comments
 (0)