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-settings-section' shows a paper material themed section with a header | |
8 * which shows its page title and icon. Note, the page title and icon are not | |
9 * bound properties, but are instead directly retrieved from the content | |
10 * element. | |
11 * | |
12 * Example: | |
13 * | |
14 * <cr-settings-section> | |
15 * <!-- Insert your section controls here --> | |
16 * </cr-settings-section> | |
17 * | |
18 * @group Chrome Settings Elements | |
19 * @element cr-settings-section | |
20 */ | |
21 Polymer({ | |
22 is: 'cr-settings-section', | |
23 | |
24 ready: function() { | |
25 // We use this trickery to retrieve the content page's title and icon, as | |
26 // Polymer does not support directly binding content element properties. | |
27 var contentElement = this.getContentChildren()[0]; | |
28 if (contentElement != undefined && | |
29 contentElement.properties != undefined) { | |
30 // Page title value is defined as a function. | |
31 this.pageTitle = contentElement.properties.pageTitle.value(); | |
32 // Icon value is defined as a property. | |
33 this.icon = contentElement.properties.icon.value; | |
Dan Beam
2015/07/22 23:12:17
why are we setting titles in JS vs just with i18n-
michaelpg
2015/07/22 23:26:55
basically we bound the header to the title of the
| |
34 } | |
35 } | |
36 }); | |
OLD | NEW |