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

Commit 8cab275

Browse files
author
Yvonne Yip
committed
move listenOnce to core-transition
1 parent 1240b66 commit 8cab275

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

core-transition-css.html

-10
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,6 @@
6262
});
6363
node.classList.toggle(this.openedClass, opened);
6464
node.classList.toggle(this.closedClass, !opened);
65-
},
66-
67-
// TODO(sorvell): worth promoting
68-
listenOnce: function(node, event, fn, args) {
69-
var self = this;
70-
var listener = function() {
71-
fn.apply(self, args);
72-
node.removeEventListener(event, listener, false);
73-
}
74-
node.addEventListener(event, listener, false);
7565
}
7666

7767
});

core-transition.html

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@
2828

2929
complete: function(node) {
3030
this.fire('core-transitionend', null, node);
31-
}
31+
},
3232

33+
listenOnce: function(node, event, fn, args) {
34+
var self = this;
35+
var listener = function() {
36+
fn.apply(self, args);
37+
node.removeEventListener(event, listener, false);
38+
}
39+
node.addEventListener(event, listener, false);
40+
}
3341

3442
});
3543
</script>

0 commit comments

Comments
 (0)