浏览代码

UI: Bind Element to callback.

Mr.doob 11 年之前
父节点
当前提交
b55c1c20a4
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      editor/js/libs/ui.js

+ 2 - 1
editor/js/libs/ui.js

@@ -77,7 +77,8 @@ events.forEach( function ( event ) {
 
 	UI.Element.prototype[ method ] = function ( callback ) {
 
-		this.dom.addEventListener( event.toLowerCase(), callback, false );
+		this.dom.addEventListener( event.toLowerCase(), callback.bind( this ), false );
+
 		return this;
 
 	};