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:
Óscar González Fernández 2009-06-13 18:35:06 +02:00 committed by Javier Moran Rua
parent 11984b19e8
commit 4cf3c1f39e

View file

@ -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) {