| Index: third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
|
| index b555b0a43bafe40f50066bbb8433abcbbdea2b7f..4c5f461075cd3a8aee96adf1816bb8a4656b03fb 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
|
| @@ -114,8 +114,8 @@ Polymer({
|
| },
|
|
|
| keyBindings: {
|
| - 'left down pagedown home': '_decrementKey',
|
| - 'right up pageup end': '_incrementKey'
|
| + 'left down pagedown home': '_leftKey',
|
| + 'right up pageup end': '_rightKey'
|
| },
|
|
|
| /**
|
| @@ -213,7 +213,9 @@ Polymer({
|
| this._trackStart(event);
|
| }
|
|
|
| - var dx = Math.min(this._maxx, Math.max(this._minx, event.detail.dx));
|
| + var direction = this._isRTL ? -1 : 1;
|
| + var dx = Math.min(
|
| + this._maxx, Math.max(this._minx, event.detail.dx * direction));
|
| this._x = this._startx + dx;
|
|
|
| var immediateValue = this._calcStep(this._calcKnobPosition(this._x / this._w));
|
| @@ -315,9 +317,30 @@ Polymer({
|
| });
|
| },
|
|
|
| - _incrementKey: function(event) {
|
| + get _isRTL() {
|
| + if (this.__isRTL === undefined) {
|
| + this.__isRTL = window.getComputedStyle(this)['direction'] === 'rtl';
|
| + }
|
| + return this.__isRTL;
|
| + },
|
| +
|
| + _leftKey: function(event) {
|
| + if (this._isRTL)
|
| + this._incrementKey(event, 'home');
|
| + else
|
| + this._decrementKey(event, 'home');
|
| + },
|
| +
|
| + _rightKey: function(event) {
|
| + if (this._isRTL)
|
| + this._decrementKey(event, 'end');
|
| + else
|
| + this._incrementKey(event, 'end');
|
| + },
|
| +
|
| + _incrementKey: function(event, allTheWayKey) {
|
| if (!this.disabled) {
|
| - if (event.detail.key === 'end') {
|
| + if (event.detail.key === allTheWayKey) {
|
| this.value = this.max;
|
| } else {
|
| this.increment();
|
| @@ -327,9 +350,9 @@ Polymer({
|
| }
|
| },
|
|
|
| - _decrementKey: function(event) {
|
| + _decrementKey: function(event, allTheWayKey) {
|
| if (!this.disabled) {
|
| - if (event.detail.key === 'home') {
|
| + if (event.detail.key === allTheWayKey) {
|
| this.value = this.min;
|
| } else {
|
| this.decrement();
|
|
|