From: Marius Olbertz Date: Wed, 19 Apr 2017 05:40:06 +0000 (+0200) Subject: Added keyboard bindings for home and end. X-Git-Tag: v6.4.0-rc1~64^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af93a33b67a49b011b010f93ac78a9e82fada75f;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Added keyboard bindings for home and end. Home sets value to minimum. End sets value to maximum. This implementation follows the w3 specs. --- diff --git a/js/foundation.slider.js b/js/foundation.slider.js index e53f00e1f..32e2faf36 100644 --- a/js/foundation.slider.js +++ b/js/foundation.slider.js @@ -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);