@@ -59,8 +59,8 @@ found here: https://github.com/Polymer/core-list
5959
6060 behaviors : [
6161 StrandTraits . Resolvable ,
62- StrandTraits . StampBindable ,
6362 StrandTraits . WindowNotifier ,
63+ StrandTraits . PatternHelpable ,
6464 StrandTraits . SizeResponsible ,
6565 ] ,
6666
@@ -80,20 +80,6 @@ found here: https://github.com/Polymer/core-list
8080 value : null ,
8181 notify : true ,
8282 } ,
83- itemTemplate : {
84- type : String ,
85- // value: ""
86- value : false
87- } ,
88- itemTemplateElement : {
89- type : Object ,
90- value : null ,
91- } ,
92- _templatized : {
93- type : Object ,
94- value : null ,
95- readOnly : true ,
96- } ,
9783 index : {
9884 type : Number ,
9985 value : 0 ,
@@ -188,7 +174,7 @@ found here: https://github.com/Polymer/core-list
188174 } ,
189175
190176 observers : [
191- "_needsInitialization(data, itemTemplate, itemTemplateElement )" ,
177+ "_needsInitialization(data, _pattern )" ,
192178 "_scopeChanged(scope.*)" ,
193179 "_dataChanged(data.*)" ,
194180 ] ,
@@ -207,6 +193,9 @@ found here: https://github.com/Polymer/core-list
207193
208194 if ( modelChanged &&
209195 delimiter > offset ) {
196+ if ( path . charCodeAt ( offset ) === "#" . charCodeAt ( 0 ) ) {
197+ offset += 1 ;
198+ }
210199 num = Number ( path . slice ( offset , delimiter ) ) ;
211200 if ( ! isNaN ( num ) ) {
212201 for ( index ; index < count ; index ++ ) {
@@ -273,7 +262,9 @@ found here: https://github.com/Polymer/core-list
273262 if ( delta ) {
274263 itemRecycler . _viewportHeight += delta ;
275264
276- itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
265+ if ( itemRecycler . hasPattern ( ) ) {
266+ itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
267+ }
277268 itemRecycler . _repositionFooter ( ) ;
278269 itemRecycler . debounce ( "settle-down" , itemRecycler . _settleDown , 1 ) ;
279270 }
@@ -287,7 +278,9 @@ found here: https://github.com/Polymer/core-list
287278 itemRecycler . _headerHeight += delta ;
288279 itemRecycler . _viewportHeight -= delta ;
289280
290- itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
281+ if ( itemRecycler . hasPattern ( ) ) {
282+ itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
283+ }
291284 itemRecycler . _repositionMiddle ( ) ;
292285 itemRecycler . _repositionFooter ( ) ;
293286 itemRecycler . debounce ( "settle-down" , itemRecycler . _settleDown , 1 ) ;
@@ -302,7 +295,9 @@ found here: https://github.com/Polymer/core-list
302295 itemRecycler . _footerHeight += delta ;
303296 itemRecycler . _viewportHeight -= delta ;
304297
305- itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
298+ if ( itemRecycler . hasPattern ( ) ) {
299+ itemRecycler . _recycler . resizeFrame ( itemRecycler . _viewportHeight ) ;
300+ }
306301 itemRecycler . _repositionFooter ( ) ;
307302 itemRecycler . debounce ( "settle-down" , itemRecycler . _settleDown , 1 ) ;
308303 }
@@ -421,15 +416,15 @@ found here: https://github.com/Polymer/core-list
421416 }
422417 } ,
423418
424- _needsInitialization : function ( ) {
419+ _needsInitialization : function ( data , _pattern ) {
425420 this . _initializable = false ;
426421 this . initialize ( ) ;
427422 } ,
428423
429424 initialize : function ( ) {
430425 if ( ! this . data ) {
431426 return 0 | false ;
432- } else if ( ! this . initializeTemplateBind ( ) ) {
427+ } else if ( ! this . hasPattern ( ) ) {
433428 return 0 | false ;
434429 } else if ( this . $ . extent . offsetHeight < 1 ) {
435430 this . _waiting = true ;
@@ -441,24 +436,6 @@ found here: https://github.com/Polymer/core-list
441436 }
442437 } ,
443438
444- initializeTemplateBind : function ( ) {
445- if ( ! this . itemTemplateElement &&
446- this . itemTemplate &&
447- typeof this . itemTemplate === "string" ) {
448- this . itemTemplateElement = Polymer . dom ( this ) . querySelector ( "template#" + this . itemTemplate ) ;
449- }
450-
451- if ( ! this . itemTemplateElement ) {
452- return 0 | false ;
453- } else {
454- if ( this . _templatized !== this . itemTemplateElement ) {
455- this . _set_templatized ( this . itemTemplateElement ) ;
456- this . templatize ( this . itemTemplateElement ) ;
457- }
458- return 0 | true ;
459- }
460- } ,
461-
462439 initializeRecycler : function ( ) {
463440 if ( ! this . _initializable ) {
464441 if ( this . _recycler . truncate ( 0 ) ) {
@@ -644,13 +621,16 @@ found here: https://github.com/Polymer/core-list
644621 }
645622 count = binds . push ( bound = new BoundReference ( this , id ) ) ;
646623 bound . value = new BoundValue ( null , this . scope ) ;
647- bound . instance = this . stamp ( bound . value ) ;
624+ bound . instance = content = this . clonePattern ( bound . value ) || null ;
625+
626+ if ( ! bound . instance ) {
627+ bound . instance = this . stampPattern ( bound . value ) ;
628+ content = Polymer . dom ( bound . instance . root ) . querySelector ( "*" ) ;
629+ }
648630
649- // assigning to the bound.value pre-stamp() is not sufficient -- must use bound.instance.set()
650631 bound . instance . set ( "scope" , this . scope ) ;
651632 bound . instance . set ( "model" , this . data [ young ] ) ;
652633
653- content = Polymer . dom ( bound . instance . root ) . querySelector ( "*" ) ;
654634 bound . element = document . createElement ( "DIV" ) ;
655635 this . toggleClass ( "recycler-panel" , true , bound . element ) ;
656636 Polymer . dom ( bound . element ) . appendChild ( content ) ;
0 commit comments