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

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: Created 5 years, 9 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 55f53bbf3854feaebdf305bed92df2acce7a9ef2..c4c82b0209820d74f50f77030fb273c203977a9e 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -14,6 +14,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";
mdjones 2015/04/03 22:35:39 Note that "transition" is not a standard feature:
+ 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