OLD | NEW |
| (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 mediaQuery = '(max-width: 420px) and (orientation: portrait),' + | |
15 '(max-width: 736px) and (max-height: 420px) and (orientation: landscape)'; | |
16 | |
17 mobileNav = window.matchMedia(mediaQuery).matches; | |
18 | |
19 mainContent.classList.toggle('hidden', false); | |
20 helpOuterBox.classList.toggle('hidden', true); | |
21 } | |
22 | |
23 function setupMobileNav() { | |
24 window.addEventListener('resize', onResize); | |
25 onResize(); | |
26 } | |
27 | |
28 document.addEventListener('DOMContentLoaded', setupMobileNav); | |
OLD | NEW |