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 3 found in the LICENSE file. 4 */ 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 and 11 * register a handler to add the 'hide' class to the container element in order 12 * to hide it. 13 */ 14 document.addEventListener('DOMContentLoaded', function(event) { 15 if (config['hideHeader']) { 16 $('container').removeChild($('header-image')); 17 } 18 $('optin-label').addEventListener('click', function() { 19 $('container').classList.add('hide'); 20 }); 21 }); 22 23 /** 24 * Returns the height of the content. Method called from Chrome to properly size 25 * the view embedding it. 26 * @return {number} The height of the content, in pixels. 27 */ 28 function getContentHeight() { 29 return $('container').clientHeight; 30 } 31