Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/resources/settings/settings_page/settings_section.js

Issue 1241363002: Settings Rewrite: Make a common settings-section component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0300-webui-settings-structure
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.
9 *
10 * Example:
11 *
12 * <cr-settings-section page-title="[[pageTitle]]", icon="[[icon]]">
michaelpg 2015/07/22 21:01:32 no comma
tommycli 2015/07/22 23:54:38 Done.
13 * <!-- Insert your section controls here -->
14 * </cr-settings-section>
15 *
16 * @group Chrome Settings Elements
17 * @element cr-settings-section
18 */
19 Polymer({
20 is: 'cr-settings-section',
21
22 ready: function() {
23 // We use this trickery to retrieve the content page's title and icon, as
24 // Polymer does not support directly binding content element properties.
25 var contentElement = this.getContentChildren()[0];
26 if (contentElement !== undefined &&
michaelpg 2015/07/22 21:01:32 nit: use != instead of !==
tommycli 2015/07/22 23:54:37 Deleted this.
27 contentElement.properties !== undefined) {
28 // Page title value is defined as a function.
29 this.pageTitle = contentElement.properties.pageTitle.value();
michaelpg 2015/07/22 21:01:32 this means updating a page's pageTitle or icon has
michaelpg 2015/07/22 21:01:32 does contentElement.pageTitle not work?
Dan Beam 2015/07/22 21:56:31 ^ this
Dan Beam 2015/07/22 21:56:31 why are we duplicating the title to begin with? c
Dan Beam 2015/07/22 22:03:07 scratch the parent part, thought this was a subpag
tommycli 2015/07/22 23:54:37 Deleted this.
tommycli 2015/07/22 23:54:38 Deleted this.
30 // Icon value is defined as a property.
31 this.icon = contentElement.properties.icon.value;
32 }
33 }
34 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698