mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 00:45:14 +00:00
Fix StdEventTarget object
This commit is contained in:
parent
d17138a980
commit
b83e2671f9
|
@ -363,7 +363,7 @@ function StdEventTarget() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addEventListener = function(type, listener) {
|
this.addEventListener = function(type, listener) {
|
||||||
if (typeof f === "function") {
|
if (typeof listener === "function") {
|
||||||
this.__events__.push({
|
this.__events__.push({
|
||||||
"type": type,
|
"type": type,
|
||||||
"listener": listener,
|
"listener": listener,
|
||||||
|
@ -376,7 +376,7 @@ function StdEventTarget() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.removeEventListener = function(type, listener) {
|
this.removeEventListener = function(type, listener) {
|
||||||
if (typeof f === "function") {
|
if (typeof listener === "function") {
|
||||||
for (var i = 0; i < this.__events__.length; i++) {
|
for (var i = 0; i < this.__events__.length; i++) {
|
||||||
var e = this.__events__[i];
|
var e = this.__events__[i];
|
||||||
if (e.type == event.type && typeof(e.listener) === "function" && e.listener.toString() == listener.toString()) {
|
if (e.type == event.type && typeof(e.listener) === "function" && e.listener.toString() == listener.toString()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user