Avoiding the creation of a mouse listener per task instantiation. They were hogging the cpu when there are a lot of tasks.
This commit is contained in:
parent
11984b19e8
commit
4cf3c1f39e
1 changed files with 7 additions and 6 deletions
|
|
@ -84,17 +84,18 @@ zkTask.init = function(cmp) {
|
|||
}, zkTask, true);
|
||||
|
||||
|
||||
// Listen to mousemove events
|
||||
YAHOO.util.Event.on(document.body, 'mousemove', function(e) {
|
||||
var arrPos = YAHOO.util.Event.getXY(e);
|
||||
zkTask.xMouse = arrPos[0];
|
||||
zkTask.yMouse = arrPos[1];
|
||||
});
|
||||
};
|
||||
|
||||
zkTask.xMouse;
|
||||
zkTask.yMouse;
|
||||
|
||||
// Listen to mousemove events
|
||||
YAHOO.util.Event.on(document.body, 'mousemove', function(e) {
|
||||
var arrPos = YAHOO.util.Event.getXY(e);
|
||||
zkTask.xMouse = arrPos[0];
|
||||
zkTask.yMouse = arrPos[1];
|
||||
});
|
||||
|
||||
zkTask.setAttr = function(cmp, nm, val) {
|
||||
|
||||
switch (nm) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue