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

Unified Diff: chrome/browser/resources/security_warnings/interstitial_v2_mobile.js

Issue 916093003: Intersitial page updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Optimise icons, update secondary button colour Created 5 years, 10 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: chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
diff --git a/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js b/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
index d524779422e940e95454b7d77d602ff399ccc022..af0a21d3a65dc4a90f5a3c5dce1a8cc21d82f8f8 100644
--- a/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
+++ b/chrome/browser/resources/security_warnings/interstitial_v2_mobile.js
@@ -11,15 +11,24 @@ var mobileNav = false;
function onResize() {
var helpOuterBox = document.querySelector('#details');
var mainContent = document.querySelector('#main-content');
- var mediaQuery = '(max-width: 420px) and (orientation: portrait),' +
- '(max-width: 736px) and (max-height: 420px) and (orientation: landscape)';
+ var mediaQuery = '(min-width: 300px) and (max-width: 420px) and ' +
+ '(orientation: portrait), (max-width: 736px) and ' +
+ '(max-height: 420px) and (orientation: landscape)';
+ var detailsHidden = helpOuterBox.classList.contains('hidden');
// Check for change in nav status.
if (mobileNav != window.matchMedia(mediaQuery).matches) {
- // Show the top content and reset the details section to hidden.
- mainContent.classList.toggle('hidden', false);
- helpOuterBox.classList.toggle('hidden', true);
mobileNav = !mobileNav;
+
+ // Handle showing the top content / details sections according to state.
+ if (mobileNav) {
+ mainContent.classList.toggle('hidden', !detailsHidden);
+ helpOuterBox.classList.toggle('hidden', detailsHidden);
+ } else if (!detailsHidden) {
+ // Non mobile nav with visible details.
+ mainContent.classList.remove('hidden');
+ helpOuterBox.classList.remove('hidden');
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698