Commit 83355348 authored by raymes's avatar raymes Committed by Commit bot

Make sure the PDF material toolbar gets hidden after loading.

Currently the toolbar won't get hidden until after there is some user input.

Review URL: https://codereview.chromium.org/966293002

Cr-Commit-Position: refs/heads/master@{#318646}
parent 9ee68196
......@@ -447,6 +447,9 @@ PDFViewer.prototype = {
});
while (this.delayedScriptingMessages_.length > 0)
this.handleScriptingMessage(this.delayedScriptingMessages_.shift());
if (this.isMaterial_)
this.uiManager_.hideUiAfterTimeout();
}
},
......
......@@ -35,9 +35,7 @@ UiManager.prototype = {
for (var i = 0; i < this.panes_.length; i++)
this.panes_[i].showIfOpenedByUser();
if (this.uiTimeout_)
clearTimeout(this.uiTimeout_);
this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT);
this.hideUiAfterTimeout();
},
/**
......@@ -48,5 +46,14 @@ UiManager.prototype = {
this.toolbar_.hide();
for (var i = 0; i < this.panes_.length; i++)
this.panes_[i].hideIfOpenedByUser();
},
/**
* Hide the toolbar after the HIDE_TIMEOUT has elapsed.
*/
hideUiAfterTimeout: function() {
if (this.uiTimeout_)
clearTimeout(this.uiTimeout_);
this.uiTimeout_ = setTimeout(this.hideUi_.bind(this), HIDE_TIMEOUT);
}
};
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