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

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

Issue 1125343004: Add a "Simplify Page" option to the print preview dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for the failing tests Created 5 years, 4 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
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 a00d738d8231758c61be9650a18c4d0386a658d2..915134af6ffcda692b5b184ea5c544543f18a1ea 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -10,6 +10,14 @@ function addToPage(html) {
div.innerHTML = html;
document.getElementById('content').appendChild(div);
fillYouTubePlaceholders();
+
+ if (typeof navigate_on_initial_content_load !== 'undefined' &&
+ navigate_on_initial_content_load) {
+ navigate_on_initial_content_load = false;
+ setTimeout(function() {
+ window.location = window.location + "#loaded";
+ }, 0);
+ }
}
function fillYouTubePlaceholders() {
@@ -131,6 +139,16 @@ function showFeedbackForm(questionText, yesText, noText) {
document.getElementById('contentWrap').style.paddingBottom = '120px';
document.getElementById('feedbackContainer').style.display = 'block';
+ var mediaQuery = window.matchMedia("print");
+ mediaQuery.addListener(function (query) {
+ if (query.matches) {
+ document.getElementById('contentWrap').style.paddingBottom = '0px';
+ document.getElementById('feedbackContainer').style.display = 'none';
+ } else {
+ document.getElementById('contentWrap').style.paddingBottom = '120px';
+ document.getElementById('feedbackContainer').style.display = 'block';
+ }
+ });
}
/**

Powered by Google App Engine
This is Rietveld 408576698