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

Side by Side Diff: pkg/polymer/lib/elements/polymer-ui-theme-aware/polymer-ui-theme-aware.html

Issue 175443005: [polymer] import all elements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: updated from bower Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!--
2 Copyright 2013 The Polymer Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style
4 license that can be found in the LICENSE file.
5 -->
6 <link rel="import" href="../polymer/polymer.html">
7
8 <polymer-element name="polymer-ui-theme-aware" attributes="theme">
9 <script>
10 PolymerUI = {
11 validateTheme: function() {
12 var theme = this.theme;
13 var defaultTheme = this.defaultTheme;
14 if (!theme) {
15 var p = this;
16 while (p && !theme) {
17 theme = p.getAttribute && p.getAttribute('theme');
18 defaultTheme = defaultTheme || p.defaultTheme;
19 p = p.parentNode || p.host;
20 }
21 }
22 this.activeTheme = this.theme || theme || defaultTheme;
23 }
24 };
25 Polymer('polymer-ui-theme-aware', {
26 defaultTheme: '',
27 activeTheme: '',
28 validateTheme: PolymerUI.validateTheme,
29 enteredView: function() {
30 this.validateTheme();
31 },
32 themeChanged: function() {
33 this.activeTheme = this.theme;
34 },
35 activeThemeChanged: function(old) {
36 this.classList.switch(old, this.activeTheme);
37 }
38 });
39 </script>
40 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698