Skip to content
This repository was archived by the owner on Dec 27, 2021. It is now read-only.

Commit 56156c2

Browse files
committed
1.5.3.2
1 parent 6d7498b commit 56156c2

File tree

4 files changed

+36
-35
lines changed

4 files changed

+36
-35
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jQuery Form Styler <sup>[1.5.3.1](http://dimox.name/jquery-form-styler/#log)</sup>
1+
jQuery Form Styler <sup>[1.5.3.2](http://dimox.name/jquery-form-styler/#log)</sup>
22
==================
33

44
jQuery-плагин для стилизации элементов html-форм:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dimox/jQueryFormStyler",
3-
"version": "1.5.3.1",
3+
"version": "1.5.3.2",
44
"main": "jquery.formstyler.css",
55
"description": "jQuery-плагин для стилизации элементов html-форм",
66
"license": "MIT",

jquery.formstyler.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* jQuery Form Styler v1.5.3.1
2+
* jQuery Form Styler v1.5.3.2
33
* https://github.com/Dimox/jQueryFormStyler
44
*
55
* Copyright 2012-2014 Dimox (http://dimox.name/)
66
* Released under the MIT license.
77
*
8-
* Date: 2014.06.02
8+
* Date: 2014.06.07
99
*
1010
*/
1111

@@ -527,7 +527,7 @@
527527
if (search.length) {
528528
search.val('').keyup();
529529
notFound.hide();
530-
search.focus().keyup(function() {
530+
search.keyup(function() {
531531
var query = $(this).val();
532532
li.each(function() {
533533
if (!$(this).html().match(new RegExp('.*?' + query + '.*?', 'i'))) {
@@ -608,15 +608,16 @@
608608
})
609609
// изменение селекта с клавиатуры
610610
.on('keydown.styler keyup.styler', function(e) {
611+
var liHeight = li.data('li-height');
611612
divText.html(option.filter(':selected').text());
612613
li.removeClass('selected sel').not('.optgroup').eq(el[0].selectedIndex).addClass('selected sel');
613-
// вверх, влево, PageUp
614-
if (e.which == 38 || e.which == 37 || e.which == 33) {
615-
dropdown.scrollTop(dropdown.scrollTop() + li.filter('.selected').position().top);
614+
// вверх, влево, Page Up, Home
615+
if (e.which == 38 || e.which == 37 || e.which == 33 || e.which == 36) {
616+
ul.scrollTop(ul.scrollTop() + li.filter('.selected').position().top);
616617
}
617-
// вниз, вправо, PageDown
618-
if (e.which == 40 || e.which == 39 || e.which == 34) {
619-
dropdown.scrollTop(dropdown.scrollTop() + li.filter('.selected').position().top - dropdown.innerHeight() + liHeight);
618+
// вниз, вправо, Page Down, End
619+
if (e.which == 40 || e.which == 39 || e.which == 34 || e.which == 35) {
620+
ul.scrollTop(ul.scrollTop() + li.filter('.selected').position().top - ul.innerHeight() + liHeight);
620621
}
621622
// открываем выпадающий список при нажатии Space
622623
if (e.which == 32) {

0 commit comments

Comments
 (0)