Browse Source

UI: Bind Element to callback.

Mr.doob 11 years ago
parent
commit
b55c1c20a4
1 changed files with 2 additions and 1 deletions
  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;
 
 	};