Skip to content

Commit 6383ab9

Browse files
committed
Small fixes
1 parent cd929b8 commit 6383ab9

10 files changed

+22
-20
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jquery-selectric",
33
"description": "Fast, simple and light jQuery plugin to customize HTML selects",
4-
"version": "1.11.0",
4+
"version": "1.11.1",
55
"keywords": [
66
"select",
77
"selectbox",
@@ -10,7 +10,7 @@
1010
"input",
1111
"ui"
1212
],
13-
"homepage": "http://lcdsantos.github.io/jQuery-Selectric/",
13+
"homepage": "http://selectric.js.org/",
1414
"authors": [
1515
{
1616
"name": "Leonardo Santos",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selectric",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"main": "public/jquery.selectric.js",
55
"title": "jQuery Selectric",
66
"author": {

public/jquery.selectric.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* /,'
1010
* /'
1111
*
12-
* Selectric ϟ v1.11.0 (Dec 16 2016) - http://lcdsantos.github.io/jQuery-Selectric/
12+
* Selectric ϟ v1.11.0 (Jan 10 2017) - http://lcdsantos.github.io/jQuery-Selectric/
1313
*
14-
* Copyright (c) 2016 Leonardo Santos; MIT License
14+
* Copyright (c) 2017 Leonardo Santos; MIT License
1515
*
1616
*/
1717

@@ -275,7 +275,7 @@
275275
.wrap(hideSelectWrapper);
276276

277277
_this.originalTabindex = _this.$element.prop('tabindex');
278-
_this.$element.prop('tabindex', false);
278+
_this.$element.prop('tabindex', -1);
279279

280280
_this.populate();
281281
_this.activate();
@@ -676,7 +676,7 @@
676676
*/
677677
handleKeys: function(e) {
678678
var _this = this;
679-
var key = e.keyCode || e.which;
679+
var key = e.which;
680680
var keys = _this.options.keys;
681681

682682
var isPrevKey = $.inArray(key, keys.previous) > -1;
@@ -794,6 +794,7 @@
794794
*/
795795
detectItemVisibility: function(index) {
796796
var _this = this;
797+
var $filteredLi = _this.$li.filter('[data-index]');
797798

798799
if ( _this.state.multiple ) {
799800
// If index is an array, we can assume a multiple select and we
@@ -803,8 +804,8 @@
803804
index = $.isArray(index) ? Math.min.apply(Math, index) : index;
804805
}
805806

806-
var liHeight = _this.$li.eq(index).outerHeight();
807-
var liTop = _this.$li[index].offsetTop;
807+
var liHeight = $filteredLi.eq(index).outerHeight();
808+
var liTop = $filteredLi[index].offsetTop;
808809
var itemsScrollTop = _this.elements.itemsScroll.scrollTop();
809810
var scrollT = liTop + liHeight * 2;
810811

public/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.

public/plugins/jquery.selectric.addNew.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Selectric AddNew ϟ v0.2.0 (2016-10-06) - git.io/tjl9sQ - Copyright (c) 2016 David Shen (git.io/mhQmLQ) - MIT License */
1+
/*! Selectric AddNew ϟ v0.2.0 (2017-01-11) - git.io/tjl9sQ - Copyright (c) 2017 David Shen (git.io/mhQmLQ) - MIT License */
22
(function(factory) {
33
/* global define */
44
if ( typeof define === 'function' && define.amd ) {

public/plugins/jquery.selectric.addNew.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/plugins/jquery.selectric.placeholder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Selectric Placeholder ϟ v0.2.0 (2016-10-06) - git.io/tjl9sQ - Copyright (c) 2016 Leonardo Santos - MIT License */
1+
/*! Selectric Placeholder ϟ v0.2.0 (2017-01-11) - git.io/tjl9sQ - Copyright (c) 2017 Leonardo Santos - MIT License */
22
(function(factory) {
33
/* global define */
44
if ( typeof define === 'function' && define.amd ) {

public/plugins/jquery.selectric.placeholder.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

selectric.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selectric",
3-
"version": "1.11.0",
3+
"version": "1.11.1",
44
"title": "jQuery Selectric",
55
"author": {
66
"name": "Leonardo Santos",

src/jquery.selectric.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
.wrap(hideSelectWrapper);
259259

260260
_this.originalTabindex = _this.$element.prop('tabindex');
261-
_this.$element.prop('tabindex', false);
261+
_this.$element.prop('tabindex', -1);
262262

263263
_this.populate();
264264
_this.activate();
@@ -659,7 +659,7 @@
659659
*/
660660
handleKeys: function(e) {
661661
var _this = this;
662-
var key = e.keyCode || e.which;
662+
var key = e.which;
663663
var keys = _this.options.keys;
664664

665665
var isPrevKey = $.inArray(key, keys.previous) > -1;
@@ -777,6 +777,7 @@
777777
*/
778778
detectItemVisibility: function(index) {
779779
var _this = this;
780+
var $filteredLi = _this.$li.filter('[data-index]');
780781

781782
if ( _this.state.multiple ) {
782783
// If index is an array, we can assume a multiple select and we
@@ -786,8 +787,8 @@
786787
index = $.isArray(index) ? Math.min.apply(Math, index) : index;
787788
}
788789

789-
var liHeight = _this.$li.eq(index).outerHeight();
790-
var liTop = _this.$li[index].offsetTop;
790+
var liHeight = $filteredLi.eq(index).outerHeight();
791+
var liTop = $filteredLi[index].offsetTop;
791792
var itemsScrollTop = _this.elements.itemsScroll.scrollTop();
792793
var scrollT = liTop + liHeight * 2;
793794

0 commit comments

Comments
 (0)