]> source.dussan.org Git - jquery-ui.git/commitdiff
fix for arrow key operation (refs #3801)
authorDavid Bolter <david.bolter@gmail.com>
Thu, 10 Jul 2008 14:28:19 +0000 (14:28 +0000)
committerDavid Bolter <david.bolter@gmail.com>
Thu, 10 Jul 2008 14:28:19 +0000 (14:28 +0000)
ui/ui.slider.js

index fc4cbd8702703755e56727909c1f30a0b5a7c52c..fe2d514a02d6dc58a3e4d2ee3e67cb8e77d1d8c6 100644 (file)
@@ -158,9 +158,10 @@ $.widget("ui.slider", {
        
        keydown: function(keyCode, handle) {
                if(/(37|38|39|40)/.test(keyCode)) {
+                       var oper = /(37|40)/.test(keyCode) ? "-=" : "+=";
                        this.moveTo({
-                               x: /(37|39)/.test(keyCode) ? (keyCode == 37 ? '-' : '+') + '=' + this.oneStep("x") : 0,
-                               y: /(38|40)/.test(keyCode) ? (keyCode == 38 ? '-' : '+') + '=' + this.oneStep("y") : 0
+                               x: oper + this.oneStep("x"),
+                               y: oper + this.oneStep("y")
                        }, handle);
                }
        },