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 | |
9 /** | |
10 * Once the DOM is loaded, determine if the header image is to be kept. | |
11 */ | |
12 document.addEventListener('DOMContentLoaded', function(event) { | |
13 if (config['hideHeader']) { | |
14 $('container').removeChild($('header-image')); | |
15 } | |
16 }); | |
17 | |
6 /** | 18 /** |
7 * On load, registers the handler to add the 'hide' class to the container | 19 * On load, registers the handler to add the 'hide' class to the container |
8 * element in order to hide it. | 20 * element in order to hide it. |
9 */ | 21 */ |
10 window.onload = function() { | 22 window.onload = function() { |
11 $('optin-label').addEventListener('click', function() { | 23 $('optin-label').addEventListener('click', function() { |
pedro (no code reviews)
2014/09/23 08:44:31
Move this to the DOMContentLoaded handler above an
Mathieu
2014/09/23 13:36:11
Done.
| |
12 $('container').classList.add('hide'); | 24 $('container').classList.add('hide'); |
13 }); | 25 }); |
14 }; | 26 }; |
15 | 27 |
16 /** | 28 /** |
17 * Returns the height of the content. Method called from Chrome to properly size | 29 * Returns the height of the content. Method called from Chrome to properly size |
18 * the view embedding it. | 30 * the view embedding it. |
19 * @return {number} The height of the content, in pixels. | 31 * @return {number} The height of the content, in pixels. |
20 */ | 32 */ |
21 function getContentHeight() { | 33 function getContentHeight() { |
22 return $('container').clientHeight; | 34 return $('container').clientHeight; |
23 } | 35 } |
OLD | NEW |