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 /** |
| 6 * @fileoverview |
| 7 * 'policy-group' is an MD element, that contains a description of a group |
| 8 * and all policies that are tagged with the groups name. Policies with multiple |
| 9 * tags will appear in multiple groups. |
| 10 * |
| 11 * Example: |
| 12 * |
| 13 * <policy-group></policy-group> |
| 14 * |
| 15 * By inserting an element as created with |
| 16 * |
| 17 * new PolicyGroup('systemSecurity') |
| 18 * |
| 19 * into a document's DOM would render a paper card and set the title to the |
| 20 * string with ID 'systemSecurity'. New Policies are added with |addPolicy|. |
| 21 * |
| 22 * @group Chrome Policy Elements |
| 23 * @element policy-group |
| 24 */ |
| 25 PolicyGroup = Polymer({ |
| 26 is: 'policy-group', |
| 27 |
| 28 behaviors: [I18nBehavior], |
| 29 |
| 30 properties: { |
| 31 /** Tag name used ID for card and title string. */ |
| 32 riskTag: { |
| 33 type: String, |
| 34 reflectToAttribute: true, |
| 35 }, |
| 36 |
| 37 /** Translation string for the risk tag. */ |
| 38 translatedRiskTag: { |
| 39 type: String, |
| 40 readOnly: true, |
| 41 computed: 'i18n(riskTag)' |
| 42 }, |
| 43 |
| 44 /** |
| 45 * Array containing all known policies. |
| 46 * @type {!Array<Object<string>>} |
| 47 * @private |
| 48 */ |
| 49 policies_: { |
| 50 type: Array, |
| 51 value: function() { return []; } |
| 52 } |
| 53 }, |
| 54 |
| 55 /** |
| 56 * Creates a new DOM element for the given policy. |
| 57 * @param {string} policy Name of the policy. |
| 58 */ |
| 59 addPolicy: function(policy) { |
| 60 // TODO(fhorschig): Create policy paper-items with possibility to (un)fold. |
| 61 this.push('policies_', {key: policy}); |
| 62 } |
| 63 }); |
OLD | NEW |