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 * 'cr-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 * <cr-policy-group></cr-policy-group> | |
14 * | |
15 * By inserting an element as created with | |
16 * | |
17 * new CrPolicyGroup('Privacy and Security') | |
18 * | |
19 * into a document's DOM would render a paper card with the title 'Privacy and | |
20 * Security'. New Policies are added with |addPolicy|. | |
21 * | |
22 * @group Chrome Policy Elements | |
23 * @element cr-policy-group | |
24 */ | |
25 | |
26 CrPolicyGroup = Polymer({ | |
27 is: 'cr-policy-group', | |
28 | |
29 /** @override */ | |
30 factoryImpl: function(riskTag) { | |
31 this.riskTag = riskTag; | |
32 }, | |
33 | |
34 /** | |
35 * Creates a new DOM element for the given policy. | |
36 * @param {string} tag Name of the policy. | |
stevenjb
2015/10/06 22:42:03
s/tag/policy/
fhorschig
2015/10/07 16:37:11
Done.
| |
37 */ | |
38 addPolicy: function(policy) { | |
39 // TODO(fhorschig): Create policy paper-items with possibility to (un)fold. | |
40 var node = document.createElement('p'); | |
41 node.textContent = policy; | |
42 this.$.content.appendChild(node); | |
43 }, | |
44 }); | |
OLD | NEW |