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

Side by Side Diff: chrome/browser/resources/security_warnings/interstitial_v2_mobile.js

Issue 865943002: Update SSL/malware/net error interstitial design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix hidden buttons on offline interstitial on CrOS Created 5 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var mobileNav = false;
6
7 /**
8 * For small screen mobile the navigation buttons are moved
9 * below the advanced text.
10 */
11 function onResize() {
12 var helpOuterBox = document.querySelector('#details');
13 var mainContent = document.querySelector('#main-content');
14 var mainFrame = document.querySelector('.interstitial-wrapper');
15 var navWrapper = document.querySelector('.nav-wrapper');
16
17 var mediaQuery = '(max-width: 420px) and (orientation:portrait),' +
18 '(max-width: 736px) and (max-height: 420px) and (orientation:landscape)';
19
20 if (window.matchMedia(mediaQuery).matches) {
21 if (navWrapper.parentNode != document.body) {
22 document.body.insertBefore(navWrapper, mainFrame.nextSibling);
23 mobileNav = true;
24 }
25 } else if (navWrapper.parentNode != mainContent) {
26 mainContent.appendChild(navWrapper);
27 mobileNav = false;
28 }
29 }
30
31 function setupMobileNav() {
32 window.addEventListener('resize', onResize);
33 onResize();
34 }
35
36 document.addEventListener('DOMContentLoaded', setupMobileNav);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698