| Index: third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js
|
| index 07be7b6474bd155503db4858f23e29d6052571ae..d9ea3b41536b61676e273f3a8673fa6c13c6d454 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/iron-dropdown/iron-dropdown-extracted.js
|
| @@ -34,8 +34,17 @@
|
|
|
| /**
|
| * A pixel value that will be added to the position calculated for the
|
| - * given `horizontalAlign`. Use a negative value to offset to the
|
| - * left, or a positive value to offset to the right.
|
| + * given `horizontalAlign`, in the direction of alignment. You can think
|
| + * of it as increasing or decreasing the distance to the side of the
|
| + * screen given by `horizontalAlign`.
|
| + *
|
| + * If `horizontalAlign` is "left", this offset will increase or decrease
|
| + * the distance to the left side of the screen: a negative offset will
|
| + * move the dropdown to the left; a positive one, to the right.
|
| + *
|
| + * Conversely if `horizontalAlign` is "right", this offset will increase
|
| + * or decrease the distance to the right side of the screen: a negative
|
| + * offset will move the dropdown to the right; a positive one, to the left.
|
| */
|
| horizontalOffset: {
|
| type: Number,
|
| @@ -45,8 +54,17 @@
|
|
|
| /**
|
| * A pixel value that will be added to the position calculated for the
|
| - * given `verticalAlign`. Use a negative value to offset towards the
|
| - * top, or a positive value to offset towards the bottom.
|
| + * given `verticalAlign`, in the direction of alignment. You can think
|
| + * of it as increasing or decreasing the distance to the side of the
|
| + * screen given by `verticalAlign`.
|
| + *
|
| + * If `verticalAlign` is "top", this offset will increase or decrease
|
| + * the distance to the top side of the screen: a negative offset will
|
| + * move the dropdown upwards; a positive one, downwards.
|
| + *
|
| + * Conversely if `verticalAlign` is "bottom", this offset will increase
|
| + * or decrease the distance to the bottom side of the screen: a negative
|
| + * offset will move the dropdown downwards; a positive one, upwards.
|
| */
|
| verticalOffset: {
|
| type: Number,
|
| @@ -146,6 +164,13 @@
|
| },
|
|
|
| /**
|
| + * Whether the text direction is RTL
|
| + */
|
| + _isRTL: function() {
|
| + return window.getComputedStyle(this).direction == 'rtl';
|
| + },
|
| +
|
| + /**
|
| * The element that should be used to position the dropdown when
|
| * it opens, if no position target is configured.
|
| */
|
| @@ -176,7 +201,10 @@
|
| get _horizontalAlignTargetValue() {
|
| var target;
|
|
|
| - if (this.horizontalAlign === 'right') {
|
| + // In RTL, the direction flips, so what is "right" in LTR becomes "left".
|
| + var isRTL = this._isRTL();
|
| + if ((!isRTL && this.horizontalAlign === 'right') ||
|
| + (isRTL && this.horizontalAlign === 'left')) {
|
| target = document.documentElement.clientWidth - this._positionRect.right;
|
| } else {
|
| target = this._positionRect.left;
|
| @@ -205,6 +233,18 @@
|
| },
|
|
|
| /**
|
| + * The horizontal align value, accounting for the RTL/LTR text direction.
|
| + */
|
| + get _localeHorizontalAlign() {
|
| + // In RTL, "left" becomes "right".
|
| + if (this._isRTL()) {
|
| + return this.horizontalAlign === 'right' ? 'left' : 'right';
|
| + } else {
|
| + return this.horizontalAlign;
|
| + }
|
| + },
|
| +
|
| + /**
|
| * Called when the value of `opened` changes.
|
| *
|
| * @param {boolean} opened True if the dropdown is opened.
|
| @@ -352,7 +392,7 @@
|
| return;
|
| }
|
|
|
| - this.style[this.horizontalAlign] =
|
| + this.style[this._localeHorizontalAlign] =
|
| this._horizontalAlignTargetValue + 'px';
|
|
|
| this.style[this.verticalAlign] =
|
|
|