File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 67
67
this . enteredViewCallback ( ) ;
68
68
} ,
69
69
leftViewCallback : function ( ) {
70
- this . asyncUnbindAll ( ) ;
70
+ if ( ! this . preventDispose ) {
71
+ this . asyncUnbindAll ( ) ;
72
+ }
71
73
// invoke user action
72
74
if ( this . leftView ) {
73
75
this . leftView ( ) ;
Original file line number Diff line number Diff line change 52
52
this . unbindAllProperties ( ) ;
53
53
this . super ( ) ;
54
54
// unbind shadowRoot
55
- unbindNodeTree ( this . shadowRoot ) ;
56
- // TODO(sjmiles): must also unbind inherited shadow roots
55
+ var root = this . shadowRoot ;
56
+ while ( root ) {
57
+ unbindNodeTree ( root ) ;
58
+ root = root . olderShadowRoot ;
59
+ }
57
60
this . _unbound = true ;
58
61
}
59
62
} ,
Original file line number Diff line number Diff line change 72
72
function ( node ) {
73
73
chai . assert . isTrue ( node . fooWasChanged , 'node is actually bound' ) ;
74
74
var n = document . createElement ( 'x-test' ) ;
75
- n . cancelUnbindAll ( ) ;
75
+ document . body . appendChild ( n ) ;
76
76
return [ n ] ;
77
77
} ,
78
+ function ( node ) {
79
+ node . preventDispose = true ;
80
+ node . parentNode . removeChild ( node ) ;
81
+ return [ node ] ;
82
+ } ,
78
83
function ( node ) {
79
84
chai . assert . ok ( ! node . _unbound ,
80
- 'element is bound when cancelUnbindAll is called ' ) ;
85
+ 'element is bound when preventDispose is true ' ) ;
81
86
node . unbindAll ( ) ;
82
87
chai . assert . isTrue ( node . _unbound ,
83
88
'element is unbound when unbindAll is called' ) ;
You can’t perform that action at this time.
0 commit comments