Commit e5f7aa03 authored by Hui Yingst's avatar Hui Yingst Committed by Commit Bot

Hide zoom toolbar until the UI text direction is set.

If the browser is using an RTL language, the zoom toolbar should be
displayed on the bottom left of the PDF viewer. As an extension, the
PDF viewer gets its UI directions after loading translated strings from
the backend with a latency. Due to this latency, the zoom toolbar will
first show up on the right side of the PDF viewer by default and then
switch to the left side after it gets all UI directions from the
backend.

To fix this issue, this CL will hide the zoom toolbar until all
translated strings are loaded from the backend.

Bug: 1038022
Change-Id: I6f49b888466fe9f4717c89c7b996feeda2777380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078747Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746001}
parent 7d2108cc
......@@ -13,7 +13,7 @@
<div id="sizer"></div>
<viewer-password-screen id="password-screen"></viewer-password-screen>
<viewer-zoom-toolbar id="zoom-toolbar"></viewer-zoom-toolbar>
<viewer-zoom-toolbar id="zoom-toolbar" hidden></viewer-zoom-toolbar>
<viewer-page-indicator id="page-indicator"></viewer-page-indicator>
......
......@@ -918,6 +918,9 @@ export class PDFViewer {
loadTimeData.getBoolean('pdfAnnotationsEnabled');
$('toolbar').printingEnabled = loadTimeData.getBoolean('printingEnabled');
$('zoom-toolbar').setStrings(strings);
// Display the zoom toolbar after the UI text direction is set, to ensure it
// appears on the correct side of the PDF viewer.
$('zoom-toolbar').hidden = false;
$('password-screen').strings = strings;
$('error-screen').strings = strings;
if ($('form-warning')) {
......
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