Skip to content

Commit 7caaa48

Browse files
committed
Added classes for options box positioning
1 parent b689d5e commit 7caaa48

File tree

8 files changed

+467
-458
lines changed

8 files changed

+467
-458
lines changed

dist/jquery.selectric.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric Ϟ v1.7.0 - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric Ϟ v1.7.1 - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
1414
* Copyright (c) 2014 Leonardo Santos; Dual licensed: MIT/GPL
1515
*
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
var pluginName = 'selectric',
22-
classList = 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive',
22+
classList = 'Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above',
2323
bindSufix = '.sl',
2424
defaults = {
2525
onOpen: $.noop,
@@ -342,7 +342,7 @@
342342
// Detect is the options box is inside the window
343343
function _isInViewport() {
344344
_calculateOptionsDimensions();
345-
$items.css('top', ($outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height()) ? -itemsHeight : '');
345+
$outerWrapper.toggleClass(_this.classes.above, $outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height());
346346
}
347347

348348
// Close the select options box
@@ -423,4 +423,4 @@
423423
$.data(this, pluginName, new Selectric(this, args));
424424
});
425425
};
426-
}(jQuery));
426+
}(jQuery));

dist/jquery.selectric.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/selectric.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@
137137
box-shadow: 0 0 10px -6px;
138138
}
139139

140+
.selectricAbove .selectricItems {
141+
top: auto;
142+
bottom: 100%;
143+
}
144+
140145
.selectricItems ul,.selectricItems li {
141146
list-style: none;
142147
padding: 0;

0 commit comments

Comments
 (0)