mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
Merge pull request #328 from thulka/master
Some lines that speed up event handling (20 to 18 % time spent) and make code cleaner.
This commit is contained in:
@@ -308,13 +308,8 @@
|
||||
|
||||
for (var n = 0; n < events.length; n++) {
|
||||
var pubEvent = events[n];
|
||||
// induce scope
|
||||
( function() {
|
||||
var event = pubEvent;
|
||||
that.content.addEventListener(event, function(evt) {
|
||||
that['_' + event](evt);
|
||||
}, false);
|
||||
}());
|
||||
var f = that['_' + pubEvent];
|
||||
that.content.addEventListener(pubEvent, f.bind(that), false);
|
||||
}
|
||||
},
|
||||
_mouseout: function(evt) {
|
||||
|
Reference in New Issue
Block a user