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

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

Issue 1298583002: Fix printing distilled pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no max-width for print, fix slide-down, fix feedback in preview 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
« no previous file with comments | « components/dom_distiller/core/html/preview.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 915134af6ffcda692b5b184ea5c544543f18a1ea..590a711d07cd5faf042cdee40949198b7915e018 100644
--- a/components/dom_distiller/core/javascript/dom_distiller_viewer.js
+++ b/components/dom_distiller/core/javascript/dom_distiller_viewer.js
@@ -137,18 +137,7 @@ function showFeedbackForm(questionText, yesText, noText) {
document.getElementById('feedbackNo').innerText = noText;
document.getElementById('feedbackQuestion').innerText = questionText;
- 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';
- }
- });
+ document.getElementById('feedbackContainer').classList.remove("hidden");
}
/**
@@ -187,11 +176,16 @@ document.getElementById('feedbackNo').addEventListener('click', function(e) {
document.getElementById('feedbackContainer').addEventListener('animationend',
function(e) {
- document.getElementById('feedbackContainer').style.display = 'none';
- // Close the gap where the feedback form was.
- var contentWrap = document.getElementById('contentWrap');
- contentWrap.style.transition = '0.5s';
- contentWrap.style.paddingBottom = '0px';
+ var feedbackContainer = document.getElementById('feedbackContainer');
+ feedbackContainer.classList.remove("fadeOut");
+ feedbackContainer.className += " hidden";
+ document.getElementById('contentWrap').style.paddingBottom = '120px';
+ setTimeout(function() {
+ // Close the gap where the feedback form was.
+ var contentWrap = document.getElementById('contentWrap');
+ contentWrap.style.transition = '0.5s';
+ contentWrap.style.paddingBottom = '';
+ }, 0);
}, true);
document.getElementById('contentWrap').addEventListener('transitionend',
« no previous file with comments | « components/dom_distiller/core/html/preview.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698