Skip to content

Commit 5656edc

Browse files
committed
Build assets (gulp)
1 parent b105b9d commit 5656edc

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

public/jquery.selectric.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric ϟ v1.11.1 (Jan 10 2017) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric ϟ v1.12.0 (Jul 03 2017) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2017 Leonardo Santos; MIT License
1515
*
@@ -187,7 +187,7 @@
187187
* @return {string} The string transformed to dash-case.
188188
*/
189189
toDash: function(str) {
190-
return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
190+
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
191191
},
192192

193193
/**
@@ -565,7 +565,7 @@
565565
itemData.selected ? 'selected' : ''
566566
]),
567567
$.isFunction(itemBuilder)
568-
? _this.utils.format(itemBuilder(itemData), itemData)
568+
? _this.utils.format(itemBuilder(itemData, this.$element, index), itemData)
569569
: _this.utils.format(itemBuilder, filteredItemData)
570570
);
571571
},
@@ -770,21 +770,26 @@
770770
/** Detect if the options box is inside the window */
771771
isInViewport: function() {
772772
var _this = this;
773-
var scrollTop = $win.scrollTop();
774-
var winHeight = $win.height();
775-
var uiPosX = _this.elements.outerWrapper.offset().top;
776-
var uiHeight = _this.elements.outerWrapper.outerHeight();
777773

778-
var fitsDown = (uiPosX + uiHeight + _this.itemsHeight) <= (scrollTop + winHeight);
779-
var fitsAbove = (uiPosX - _this.itemsHeight) > scrollTop;
774+
if (_this.options.forceRenderAbove === true) {
775+
_this.elements.outerWrapper.addClass(_this.classes.above);
776+
} else {
777+
var scrollTop = $win.scrollTop();
778+
var winHeight = $win.height();
779+
var uiPosX = _this.elements.outerWrapper.offset().top;
780+
var uiHeight = _this.elements.outerWrapper.outerHeight();
781+
782+
var fitsDown = (uiPosX + uiHeight + _this.itemsHeight) <= (scrollTop + winHeight);
783+
var fitsAbove = (uiPosX - _this.itemsHeight) > scrollTop;
780784

781-
// If it does not fit below, only render it
782-
// above it fit's there.
783-
// It's acceptable that the user needs to
784-
// scroll the viewport to see the cut off UI
785-
var renderAbove = !fitsDown && fitsAbove;
785+
// If it does not fit below, only render it
786+
// above it fit's there.
787+
// It's acceptable that the user needs to
788+
// scroll the viewport to see the cut off UI
789+
var renderAbove = !fitsDown && fitsAbove;
786790

787-
_this.elements.outerWrapper.toggleClass(_this.classes.above, renderAbove);
791+
_this.elements.outerWrapper.toggleClass(_this.classes.above, renderAbove);
792+
}
788793
},
789794

790795
/**
@@ -1075,6 +1080,7 @@
10751080
preventWindowScroll : true,
10761081
inheritOriginalWidth : false,
10771082
allowWrap : true,
1083+
forceRenderAbove : false,
10781084
stopPropagation : true,
10791085
optionsItemBuilder : '{text}', // function(itemData, element, index)
10801086
labelBuilder : '{text}', // function(currItem)

0 commit comments

Comments
 (0)