Commit 6587d037 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Fix viewer zoom buttons in RTL

showOnLeft_ was updated to be computed based on whether the viewer was
in Print Preview, which is set at construction rather than after
retrieving strings from the backend. As a result, the document text
direction was not yet set and the computation returned the wrong
result.

Instead, compute show on left one time when strings are set, since
neither isPrintPreview nor the document direction should change while
the viewer is open.

Fixed: 1017081
Change-Id: I849af87b361d889f1655d9d2bdb04b16fcffe454
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1877816Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709221}
parent 3909443b
......@@ -42,7 +42,6 @@ Polymer({
/** @private */
showOnLeft_: {
type: Boolean,
computed: 'computeShowOnLeft_(isPrintPreview)',
reflectToAttribute: true,
},
},
......@@ -88,15 +87,6 @@ Polymer({
this.keyboardNavigationActive_ = false;
},
/**
* @return {boolean} Whether to show the zoom toolbar on the left side of the
* viewport.
* @private
*/
computeShowOnLeft_: function() {
return isRTL() !== this.isPrintPreview;
},
/**
* Change button tooltips to match any changes to localized strings.
* @param {!{tooltipFitToPage: string,
......@@ -109,6 +99,7 @@ Polymer({
[strings.tooltipFitToPage, strings.tooltipFitToWidth];
this.$['zoom-in-button'].tooltips = [strings.tooltipZoomIn];
this.$['zoom-out-button'].tooltips = [strings.tooltipZoomOut];
this.showOnLeft_ = isRTL() !== this.isPrintPreview;
},
/** Handle clicks of the fit-button. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment