]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Added keyboard bindings for home and end.
authorMarius Olbertz <marius.olbertz@gmail.com>
Wed, 19 Apr 2017 05:40:06 +0000 (07:40 +0200)
committerMarius Olbertz <marius.olbertz@gmail.com>
Wed, 19 Apr 2017 05:40:06 +0000 (07:40 +0200)
Home sets value to minimum.
End sets value to maximum.

This implementation follows the w3 specs.

js/foundation.slider.js

index e53f00e1f8f35233037d4a7745cbab58ad8f58bb..32e2faf36c7b52706401bc48dfce1ccf390a4a1a 100644 (file)
@@ -34,7 +34,9 @@ class Slider {
         'SHIFT_ARROW_RIGHT': 'increase_fast',
         'SHIFT_ARROW_UP': 'increase_fast',
         'SHIFT_ARROW_DOWN': 'decrease_fast',
-        'SHIFT_ARROW_LEFT': 'decrease_fast'
+        'SHIFT_ARROW_LEFT': 'decrease_fast',
+        'HOME': 'min',
+        'END': 'max'
       },
       'rtl': {
         'ARROW_LEFT': 'increase',
@@ -517,6 +519,12 @@ class Slider {
         increase_fast: function() {
           newValue = oldValue + _this.options.step * 10;
         },
+        min: function() {
+          newValue = _this.options.start;
+        },
+        max: function() {
+          newValue = _this.options.end;
+        },
         handled: function() { // only set handle pos when event was handled specially
           e.preventDefault();
           _this._setHandlePos(_$handle, newValue, true);