Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: components/dom_distiller/core/javascript/dom_distiller_viewer.js

Issue 1060623002: Adds support for dynamically setting the title (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/dom_distiller/core/html/dom_distiller_viewer.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/javascript/dom_distiller_viewer.js
diff --git a/components/dom_distiller/core/javascript/dom_distiller_viewer.js b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
index b330fbbf70c80dba55ade055274bcaa47b585924..39d7f5cc55c05719797ca9b08c82078831b0aa91 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -40,6 +40,21 @@ function showLoadingIndicator(isLastPage) {
updateLoadingIndicator(isLastPage);
}
+// Sets the title. The title will be exposed with a simple animation. This
+// should only be used when the title was not included in the initial html.
+function setTitle(title) {
+ var holder = document.getElementById('titleHolder');
+ var collapse = document.getElementById('titleCollapse');
+
+ collapse.style.height = "0px";
+
+ holder.textContent = title;
+ var newHeight = Math.max(90, holder.getBoundingClientRect().height);
+
+ collapse.style.transition = "height 0.2s";
+ collapse.style.height = newHeight + "px";
+}
+
// Maps JS Font Family to CSS class and then changes body class name.
// CSS classes must agree with distilledpage.css.
function useFontFamily(fontFamily) {
« no previous file with comments | « components/dom_distiller/core/html/dom_distiller_viewer.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698