Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 25e4df2

Browse files
committed
Add support for attached/detachedCallbacks; users can now implement attached/detached; in addition, entered/leftView remain available for bc.
1 parent b61ebcb commit 25e4df2

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

src/instance/base.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,48 @@
4545
// user entry point
4646
this.ready();
4747
},
48-
enteredViewCallback: function() {
48+
attachedCallback: function() {
4949
if (!this._elementPrepared) {
5050
this.prepareElement();
5151
}
5252
this.cancelUnbindAll(true);
5353
// invoke user action
54+
if (this.attached) {
55+
this.attached();
56+
}
57+
// TODO(sorvell): bc
5458
if (this.enteredView) {
5559
this.enteredView();
5660
}
5761
},
58-
leftViewCallback: function() {
62+
detachedCallback: function() {
5963
if (!this.preventDispose) {
6064
this.asyncUnbindAll();
6165
}
6266
// invoke user action
67+
if (this.detached) {
68+
this.detached();
69+
}
70+
// TODO(sorvell): bc
6371
if (this.leftView) {
6472
this.leftView();
6573
}
6674
},
6775
// TODO(sorvell): bc
76+
enteredViewCallback: function() {
77+
this.attachedCallback();
78+
},
79+
// TODO(sorvell): bc
80+
leftViewCallback: function() {
81+
this.detachedCallback();
82+
},
83+
// TODO(sorvell): bc
6884
enteredDocumentCallback: function() {
69-
this.enteredViewCallback();
85+
this.attachedCallback();
7086
},
7187
// TODO(sorvell): bc
7288
leftDocumentCallback: function() {
73-
this.leftViewCallback();
89+
this.detachedCallback();
7490
},
7591
// recursive ancestral <element> initialization, oldest first
7692
parseDeclarations: function(p) {

0 commit comments

Comments
 (0)