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('Privacy and Security') | |
18 * | |
19 * into a document's DOM would render a paper card with the title 'Privacy | |
20 * and Security'. New Policies are added with |addPolicy|. | |
Dan Beam
2015/10/10 01:04:18
indent off, should be
* Example:
*
* <policy-gr
fhorschig
2015/10/13 16:29:11
Done.
fhorschig
2015/10/13 16:29:11
Done.
| |
21 * | |
22 * @group Chrome Policy Elements | |
23 * @element policy-group | |
24 */ | |
25 PolicyGroup = Polymer({ | |
26 is: 'policy-group', | |
27 | |
28 properties: { | |
29 /** Tag name used as title for the group card. */ | |
30 riskTag: { | |
31 type: String, | |
32 reflectToAttribute: true, | |
33 readOnly: true, | |
34 notify: false | |
35 } | |
36 }, | |
37 | |
38 /** | |
39 * @override | |
40 * @param {string} riskTag String ID used as title for the group card. | |
41 */ | |
42 factoryImpl: function(riskTag) { | |
43 this._setRiskTag(riskTag); | |
Dan Beam
2015/10/10 01:04:18
is this calling a private polymer method?
stevenjb
2015/10/12 17:02:46
I don't actually see this documented anywhere, and
fhorschig
2015/10/13 16:29:11
Isn't this a private method from this very class?
| |
44 }, | |
45 | |
46 /** | |
47 * Used in HMTL file to translate displayed string. | |
48 * @param {string} key The key for the i18n. | |
49 * @return {string} i18n of |key|. | |
50 */ | |
51 translate: function(key) { | |
Dan Beam
2015/10/10 01:04:18
is this used outside of this function?
Dan Beam
2015/10/10 01:04:18
can you use I18nBehavior for this (and maybe move
stevenjb
2015/10/12 16:55:37
Dan: I just noticed that we put i18n_behavior in c
Dan Beam
2015/10/12 18:14:20
yes, now that there's a need for it from other pla
fhorschig
2015/10/13 16:29:11
It is not used outside this function. As proposed,
| |
52 return loadTimeData.getString(key); | |
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 var node = document.createElement('p'); | |
62 node.textContent = policy; | |
63 this.$.content.appendChild(node); | |
64 } | |
65 }); | |
OLD | NEW |