This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 136136 this . style . backgroundImage = 'url(' + this . src + ')' ;
137137 this . updateIcon ( ) ;
138138 } ,
139- themeChanged : function ( old ) {
139+ activeThemeChanged : function ( old ) {
140140 this . super ( arguments ) ;
141141 this . style . backgroundPosition = '' ;
142- this . bx = calcThemeOffset ( this . theme , this ) ;
142+ this . bx = calcThemeOffset ( this . activeTheme , this ) ;
143143 this . updateIcon ( ) ;
144144 } ,
145145 updateIcon : function ( ) {
Original file line number Diff line number Diff line change 5757< link rel ="import " href ="../../polymer-elements/polymer-selector/polymer-selector.html ">
5858< link rel ="import " href ="../polymer-ui-theme-aware/polymer-ui-theme-aware.html ">
5959
60- < polymer-element name ="polymer-ui-menu " extends ="polymer-selector "
61- attributes ="theme " on-polymer-select ="selectionChange ">
60+ < polymer-element name ="polymer-ui-menu " extends ="polymer-selector " attributes ="theme " on-polymer-select ="selectionChange ">
6261 < template >
6362 < link rel ="stylesheet " href ="polymer-ui-menu.css ">
6463 < shadow > </ shadow >
6564 </ template >
6665 < script >
6766 Polymer ( 'polymer-ui-menu' , {
67+ activeTheme : '' ,
68+ validateTheme : PolymerUI . validateTheme ,
6869 enteredView : function ( ) {
69- if ( ! this . theme ) {
70- this . findTheme ( ) ;
71- }
70+ this . validateTheme ( ) ;
71+ } ,
72+ themeChanged : function ( ) {
73+ this . activeTheme = this . theme ;
7274 } ,
73- findTheme : PolymerUI . findTheme ,
74- themeChanged : function ( old ) {
75- this . classList . switch ( old , this . theme ) ;
75+ activeThemeChanged : function ( old ) {
76+ this . classList . switch ( old , this . activeTheme ) ;
7677 } ,
7778 selectionChange : function ( e , detail ) {
7879 if ( detail . isSelected ) {
Original file line number Diff line number Diff line change 1212 < polymer-ui-menu-item label ="Favorites 3 "> </ polymer-ui-menu-item >
1313 < polymer-ui-menu-item label ="Favorites 4 "> </ polymer-ui-menu-item >
1414 </ polymer-ui-submenu-item >
15- < polymer-ui-menu -item icon ="settings " label ="Explore ">
15+ < polymer-ui-submenu -item icon ="settings " label ="Explore ">
1616 < polymer-ui-menu-item label ="Explore 1 "> </ polymer-ui-menu-item >
1717 < polymer-ui-menu-item label ="Explore 2 "> </ polymer-ui-menu-item >
18- </ polymer-ui-menu -item >
18+ </ polymer-ui-submenu -item >
1919 </ polymer-ui-sidebar-menu >
2020 </ template >
2121 < template id ="imports ">
Original file line number Diff line number Diff line change 55-->
66< polymer-element name ="polymer-ui-theme-aware " attributes ="theme ">
77 < script >
8- PolymerUI = {
9- findTheme : function ( ) {
10- var p = this , theme = null ;
11- while ( p && ! theme ) {
12- theme = p . getAttribute && p . getAttribute ( 'theme' ) ;
13- p = p . parentNode || p . host ;
8+ PolymerUI = {
9+ validateTheme : function ( ) {
10+ var theme = this . theme ;
11+ if ( ! theme ) {
12+ var p = this ;
13+ while ( p && ! theme ) {
14+ theme = p . getAttribute && p . getAttribute ( 'theme' ) ;
15+ p = p . parentNode || p . host ;
16+ }
1417 }
15- this . theme = theme ;
18+ this . activeTheme = this . theme || theme ;
1619 }
1720 } ;
1821 Polymer ( 'polymer-ui-theme-aware' , {
22+ activeTheme : '' ,
23+ validateTheme : PolymerUI . validateTheme ,
1924 enteredView : function ( ) {
20- if ( ! this . theme ) {
21- this . findTheme ( ) ;
22- }
25+ this . validateTheme ( ) ;
26+ } ,
27+ themeChanged : function ( ) {
28+ this . activeTheme = this . theme ;
2329 } ,
24- findTheme : PolymerUI . findTheme ,
25- themeChanged : function ( old ) {
26- this . classList . switch ( old , this . theme ) ;
30+ activeThemeChanged : function ( old ) {
31+ this . classList . switch ( old , this . activeTheme ) ;
2732 }
2833 } ) ;
2934 </ script >
You can’t perform that action at this time.
0 commit comments