Chromium Code Reviews| 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) { |