OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 cr.define('policy', function() { | 4 cr.define('policy', function() { |
5 | 5 |
6 /** | 6 /** |
7 * A hack to check if we are displaying the mobile version of this page by | 7 * A hack to check if we are displaying the mobile version of this page by |
8 * checking if the first column is hidden. | 8 * checking if the first column is hidden. |
9 * @return {boolean} True if this is the mobile version. | 9 * @return {boolean} True if this is the mobile version. |
10 */ | 10 */ |
11 var isMobilePage = function() { | 11 var isMobilePage = function() { |
12 return document.defaultView.getComputedStyle(document.querySelector( | 12 return document.defaultView.getComputedStyle(document.querySelector( |
13 '.scope-column')).display == 'none'; | 13 '.scope-column')).display == 'none'; |
14 } | 14 }; |
15 | 15 |
16 /** | 16 /** |
17 * A box that shows the status of cloud policy for a device or user. | 17 * A box that shows the status of cloud policy for a device or user. |
18 * @constructor | 18 * @constructor |
19 * @extends {HTMLFieldSetElement} | 19 * @extends {HTMLFieldSetElement} |
20 */ | 20 */ |
21 var StatusBox = cr.ui.define(function() { | 21 var StatusBox = cr.ui.define(function() { |
22 var node = $('status-box-template').cloneNode(true); | 22 var node = $('status-box-template').cloneNode(true); |
23 node.removeAttribute('id'); | 23 node.removeAttribute('id'); |
24 return node; | 24 return node; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 */ | 200 */ |
201 toggleExpandedValue_: function() { | 201 toggleExpandedValue_: function() { |
202 this.classList.toggle('show-overflowed-value'); | 202 this.classList.toggle('show-overflowed-value'); |
203 this.updateToggleExpandedValueText_(); | 203 this.updateToggleExpandedValueText_(); |
204 }, | 204 }, |
205 }; | 205 }; |
206 | 206 |
207 /** | 207 /** |
208 * A table of policies and their values. | 208 * A table of policies and their values. |
209 * @constructor | 209 * @constructor |
210 * @extends {HTMLTableSectionElement} | 210 * @extends {HTMLTableElement} |
211 */ | 211 */ |
212 var PolicyTable = cr.ui.define('tbody'); | 212 var PolicyTable = cr.ui.define('tbody'); |
213 | 213 |
214 PolicyTable.prototype = { | 214 PolicyTable.prototype = { |
215 // Set up the prototype chain. | 215 // Set up the prototype chain. |
216 __proto__: HTMLTableSectionElement.prototype, | 216 __proto__: HTMLTableElement.prototype, |
217 | 217 |
218 /** | 218 /** |
219 * Initialization function for the cr.ui framework. | 219 * Initialization function for the cr.ui framework. |
220 */ | 220 */ |
221 decorate: function() { | 221 decorate: function() { |
222 this.policies_ = {}; | 222 this.policies_ = {}; |
223 this.filterPattern_ = ''; | 223 this.filterPattern_ = ''; |
224 window.addEventListener('resize', this.checkOverflow_.bind(this)); | 224 window.addEventListener('resize', this.checkOverflow_.bind(this)); |
225 }, | 225 }, |
226 | 226 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 return { | 550 return { |
551 Page: Page | 551 Page: Page |
552 }; | 552 }; |
553 }); | 553 }); |
554 | 554 |
555 // Have the main initialization function be called when the page finishes | 555 // Have the main initialization function be called when the page finishes |
556 // loading. | 556 // loading. |
557 document.addEventListener( | 557 document.addEventListener( |
558 'DOMContentLoaded', | 558 'DOMContentLoaded', |
559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); | 559 policy.Page.getInstance().initialize.bind(policy.Page.getInstance())); |
OLD | NEW |