OLD | NEW |
---|---|
1 /* Copyright 2014 The Chromium Authors. All rights reserved. | 1 /* Copyright 2014 The Chromium Authors. All rights reserved. |
2 Use of this source code is governed by a BSD-style license that can be | 2 Use of this source code is governed by a BSD-style license that can be |
3 found in the LICENSE file. | 3 found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 <include src="../../../../ui/webui/resources/js/util.js"> | |
7 <include src="../../../../ui/webui/resources/js/load_time_data.js"> | |
8 | |
6 /** | 9 /** |
7 * On load, registers the handler to add the 'hide' class to the container | 10 * Once the DOM is loaded, determine if the header image is to be kept and |
8 * element in order to hide it. | 11 * register a handler to add the 'hide' class to the container element in order |
12 * to hide it. | |
9 */ | 13 */ |
10 window.onload = function() { | 14 document.addEventListener('DOMContentLoaded', function(event) { |
15 if (config['hideHeader']) { | |
huangs
2014/09/23 13:44:38
NIT: I'm a bit worried about flicker on slow machi
Mathieu
2014/09/23 13:50:08
In this context it's really the best I can think o
| |
16 $('container').removeChild($('header-image')); | |
17 } | |
11 $('optin-label').addEventListener('click', function() { | 18 $('optin-label').addEventListener('click', function() { |
12 $('container').classList.add('hide'); | 19 $('container').classList.add('hide'); |
13 }); | 20 }); |
14 }; | 21 }); |
15 | 22 |
16 /** | 23 /** |
17 * Returns the height of the content. Method called from Chrome to properly size | 24 * Returns the height of the content. Method called from Chrome to properly size |
18 * the view embedding it. | 25 * the view embedding it. |
19 * @return {number} The height of the content, in pixels. | 26 * @return {number} The height of the content, in pixels. |
20 */ | 27 */ |
21 function getContentHeight() { | 28 function getContentHeight() { |
22 return $('container').clientHeight; | 29 return $('container').clientHeight; |
23 } | 30 } |
OLD | NEW |