diff --git a/bower.json b/bower.json index 0afc7bd..cc34f13 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-editable-select", - "version": "2.2.4", + "version": "2.2.5", "authors": [ "Indri Muska " ], @@ -25,6 +25,6 @@ "bower_components" ], "dependencies": { - "jquery": ">=1.1.1 <3.0.0" + "jquery": ">=1.1.1" } } diff --git a/dist/jquery-editable-select.js b/dist/jquery-editable-select.js index 011f9be..5ac024a 100644 --- a/dist/jquery-editable-select.js +++ b/dist/jquery-editable-select.js @@ -158,16 +158,14 @@ switch (e.keyCode) { case 38: // Up var visibles = that.es.$list.find('li.es-visible:not([disabled])'); - var nextNode = visibles.filter('li.selected').prev(); - var nextIndex = visibles.index(nextNode.length > 0 ? nextNode : visibles.last()); - that.highlight(nextIndex); + var selectedIndex = visibles.index(visibles.filter('li.selected')); + that.highlight(selectedIndex - 1); e.preventDefault(); break; case 40: // Down var visibles = that.es.$list.find('li.es-visible:not([disabled])'); - var nextNode = visibles.filter('li.selected').next(); - var nextIndex = visibles.index(nextNode.length > 0 ? nextNode : visibles.first()); - that.highlight(nextIndex); + var selectedIndex = visibles.index(visibles.filter('li.selected')); + that.highlight(selectedIndex + 1); e.preventDefault(); break; case 13: // Enter diff --git a/dist/jquery-editable-select.min.css b/dist/jquery-editable-select.min.css index 09155a5..89638ea 100644 --- a/dist/jquery-editable-select.min.css +++ b/dist/jquery-editable-select.min.css @@ -1,2 +1,2 @@ -/*! jQuery Editable Select - v2.2.4 - https://github.com/indrimuska/jquery-editable-select - (c) 2016 Indri Muska - MIT */ +/*! jQuery Editable Select - v2.2.5 - https://github.com/indrimuska/jquery-editable-select - (c) 2016 Indri Muska - MIT */ input.es-input{padding-right:20px!important;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAICAYAAADJEc7MAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAG2YAABzjgAA4DIAAIM2AAB5CAAAxgwAADT6AAAgbL5TJ5gAAABGSURBVHjaYvz//z8DOYCJgUzA0tnZidPK8vJyRpw24pLEpwnuVHRFhDQxMDAwMPz//x+OOzo6/iPz8WFGuocqAAAA//8DAD/sORHYg7kaAAAAAElFTkSuQmCC) right center no-repeat}input.es-input.open{-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-bottomright:0;border-bottom-right-radius:0}.es-list{position:absolute;padding:0;margin:0;border:1px solid #d1d1d1;display:none;z-index:1000;background:#fff;max-height:160px;overflow-y:auto;-moz-box-shadow:0 2px 3px #ccc;-webkit-box-shadow:0 2px 3px #ccc;box-shadow:0 2px 3px #ccc}.es-list li{display:block;padding:5px 10px;margin:0}.es-list li.selected{background:#f3f3f3}.es-list li[disabled]{opacity:.5} \ No newline at end of file diff --git a/dist/jquery-editable-select.min.js b/dist/jquery-editable-select.min.js index b7e0e8c..bba09fa 100644 --- a/dist/jquery-editable-select.min.js +++ b/dist/jquery-editable-select.min.js @@ -1,2 +1,2 @@ -/*! jQuery Editable Select - v2.2.4 - https://github.com/indrimuska/jquery-editable-select - (c) 2016 Indri Muska - MIT */ -+function(a){EditableSelect=function(b,c){this.options=c,this.$select=a(b),this.$input=a(''),this.$list=a('