mui-sass 0.9.27 → 0.9.28
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9838ec4cc616cc23a464cb3a27334a4f26f9b2c
|
4
|
+
data.tar.gz: b15383f90e0811811d3f573e31bdc486b47e8d4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 665edc4f1af2fd42abdfc3c3c55571ba31c5858238383ca24a59a3be268b20f0de29e8f3432bb24ffec330053f2b2a2dfe2480b0084f182e14be0ecf98411552
|
7
|
+
data.tar.gz: 7946b403b214369b7a7e2eb28a4f030f8af6694ea238b403aaa370eb3fd3d6f73163f4b0e99cab7e72669fba4f609efeda082bd1ae4bbc87c4b440d4d5db2a04
|
data/CHANGELOG.md
CHANGED
data/lib/mui/sass/version.rb
CHANGED
@@ -161,29 +161,29 @@ module.exports = {
|
|
161
161
|
|
162
162
|
'use strict';
|
163
163
|
|
164
|
-
var
|
165
|
-
inputHeight = 32, // from CSS
|
166
|
-
rowHeight = 42, // from CSS
|
167
|
-
menuPadding = 8; // from CSS
|
164
|
+
var jqLite = require('./jqLite');
|
168
165
|
|
169
166
|
|
170
167
|
/**
|
171
168
|
* Menu position/size/scroll helper
|
172
169
|
* @returns {Object} Object with keys 'height', 'top', 'scrollTop'
|
173
170
|
*/
|
174
|
-
function getMenuPositionalCSSFn(wrapperEl,
|
175
|
-
var viewHeight = document.documentElement.clientHeight
|
171
|
+
function getMenuPositionalCSSFn(wrapperEl, menuEl, selectedRow) {
|
172
|
+
var viewHeight = document.documentElement.clientHeight,
|
173
|
+
numRows = menuEl.children.length;
|
176
174
|
|
177
|
-
// determine
|
178
|
-
var h =
|
175
|
+
// determine menu height
|
176
|
+
var h = parseInt(menuEl.offsetHeight),
|
179
177
|
height = Math.min(h, viewHeight);
|
180
178
|
|
179
|
+
// determine row height
|
180
|
+
var p = parseInt(jqLite.css(menuEl, 'padding-top')),
|
181
|
+
rowHeight = (h - 2 * p) / numRows;
|
182
|
+
|
181
183
|
// determine 'top'
|
182
184
|
var top, initTop, minTop, maxTop;
|
183
185
|
|
184
|
-
initTop =
|
185
|
-
initTop -= selectedRow * rowHeight;
|
186
|
-
|
186
|
+
initTop = -1 * selectedRow * rowHeight;
|
187
187
|
minTop = -1 * wrapperEl.getBoundingClientRect().top;
|
188
188
|
maxTop = (viewHeight - height) + minTop;
|
189
189
|
|
@@ -195,9 +195,8 @@ function getMenuPositionalCSSFn(wrapperEl, numRows, selectedRow) {
|
|
195
195
|
scrollMax;
|
196
196
|
|
197
197
|
if (h > viewHeight) {
|
198
|
-
scrollIdeal =
|
199
|
-
|
200
|
-
scrollMax = numRows * rowHeight + 2 * menuPadding - height;
|
198
|
+
scrollIdeal = top + p + selectedRow * rowHeight;
|
199
|
+
scrollMax = numRows * rowHeight + 2 * p - height;
|
201
200
|
scrollTop = Math.min(scrollIdeal, scrollMax);
|
202
201
|
}
|
203
202
|
|
@@ -214,7 +213,7 @@ module.exports = {
|
|
214
213
|
getMenuPositionalCSS: getMenuPositionalCSSFn
|
215
214
|
};
|
216
215
|
|
217
|
-
},{}],5:[function(require,module,exports){
|
216
|
+
},{"./jqLite":5}],5:[function(require,module,exports){
|
218
217
|
/**
|
219
218
|
* MUI CSS/JS jqLite module
|
220
219
|
* @module lib/jqLite
|
@@ -1574,7 +1573,9 @@ function Menu(wrapperEl, selectEl, wrapperCallbackFn) {
|
|
1574
1573
|
this.currentPos = null;
|
1575
1574
|
this.selectEl = selectEl;
|
1576
1575
|
this.wrapperEl = wrapperEl;
|
1577
|
-
|
1576
|
+
|
1577
|
+
var res = this._createMenuEl(wrapperEl, selectEl),
|
1578
|
+
menuEl = this.menuEl = res[0];
|
1578
1579
|
|
1579
1580
|
var cb = util.callback;
|
1580
1581
|
|
@@ -1584,11 +1585,20 @@ function Menu(wrapperEl, selectEl, wrapperCallbackFn) {
|
|
1584
1585
|
|
1585
1586
|
// add to DOM
|
1586
1587
|
wrapperEl.appendChild(this.menuEl);
|
1587
|
-
|
1588
|
+
|
1589
|
+
// set position
|
1590
|
+
var props = formlib.getMenuPositionalCSS(
|
1591
|
+
wrapperEl,
|
1592
|
+
menuEl,
|
1593
|
+
res[1]
|
1594
|
+
);
|
1595
|
+
|
1596
|
+
jqLite.css(menuEl, props);
|
1597
|
+
jqLite.scrollTop(menuEl, props.scrollTop);
|
1588
1598
|
|
1589
1599
|
// attach event handlers
|
1590
1600
|
var destroyCB = this.destroyCB;
|
1591
|
-
jqLite.on(
|
1601
|
+
jqLite.on(menuEl, 'click', this.onClickCB);
|
1592
1602
|
jqLite.on(win, 'resize', destroyCB);
|
1593
1603
|
|
1594
1604
|
// attach event handler after current event loop exits
|
@@ -1608,6 +1618,7 @@ Menu.prototype._createMenuEl = function(wrapperEl, selectEl) {
|
|
1608
1618
|
origPos = -1,
|
1609
1619
|
selectedPos = 0,
|
1610
1620
|
selectedRow = 0,
|
1621
|
+
numRows = 0,
|
1611
1622
|
docFrag = document.createDocumentFragment(), // for speed
|
1612
1623
|
loopEl,
|
1613
1624
|
rowEl,
|
@@ -1658,7 +1669,7 @@ Menu.prototype._createMenuEl = function(wrapperEl, selectEl) {
|
|
1658
1669
|
|
1659
1670
|
// handle selected options
|
1660
1671
|
if (loopEl.selected) {
|
1661
|
-
selectedRow =
|
1672
|
+
selectedRow = numRows;
|
1662
1673
|
origPos = itemPos;
|
1663
1674
|
selectedPos = itemPos;
|
1664
1675
|
}
|
@@ -1669,6 +1680,7 @@ Menu.prototype._createMenuEl = function(wrapperEl, selectEl) {
|
|
1669
1680
|
}
|
1670
1681
|
|
1671
1682
|
docFrag.appendChild(rowEl);
|
1683
|
+
numRows += 1;
|
1672
1684
|
}
|
1673
1685
|
}
|
1674
1686
|
|
@@ -1682,17 +1694,7 @@ Menu.prototype._createMenuEl = function(wrapperEl, selectEl) {
|
|
1682
1694
|
// paint selectedPos
|
1683
1695
|
if (itemArray.length) jqLite.addClass(itemArray[selectedPos], selectedClass);
|
1684
1696
|
|
1685
|
-
|
1686
|
-
var props = formlib.getMenuPositionalCSS(
|
1687
|
-
wrapperEl,
|
1688
|
-
menuEl.children.length,
|
1689
|
-
selectedRow
|
1690
|
-
);
|
1691
|
-
|
1692
|
-
jqLite.css(menuEl, props);
|
1693
|
-
menuEl._scrollTop = props.scrollTop;
|
1694
|
-
|
1695
|
-
return menuEl;
|
1697
|
+
return [menuEl, selectedRow];
|
1696
1698
|
}
|
1697
1699
|
|
1698
1700
|
|
@@ -126,8 +126,8 @@ $xFormLabelLineHeight: floor($mui-label-font-size * 1.25);
|
|
126
126
|
|
127
127
|
> div {
|
128
128
|
padding: 0 22px;
|
129
|
-
height: $mui-select-menu-
|
130
|
-
line-height: $mui-select-menu-
|
129
|
+
height: $mui-select-menu-item-height;
|
130
|
+
line-height: $mui-select-menu-item-height;
|
131
131
|
cursor: pointer;
|
132
132
|
white-space: nowrap;
|
133
133
|
|
@@ -191,8 +191,9 @@ $mui-form-group-margin-bottom: 20px !default;
|
|
191
191
|
// SELECT
|
192
192
|
// ============================================================================
|
193
193
|
|
194
|
-
$mui-select-menu-font-size:
|
195
|
-
$mui-select-menu-bg-color:
|
194
|
+
$mui-select-menu-font-size: $mui-input-font-size !default;
|
195
|
+
$mui-select-menu-bg-color: mui-color('white') !default;
|
196
|
+
$mui-select-menu-item-height: $mui-select-menu-font-size + 26px !default;
|
196
197
|
$mui-select-menu-item-bg-color-selected: mui-color('grey', '200') !default;
|
197
198
|
$mui-select-menu-item-bg-color-hover: mui-color('grey', '300') !default;
|
198
199
|
|