From 4cf3c1f39eaff2df329f31be76a69d9774085457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Sat, 13 Jun 2009 18:35:06 +0200 Subject: [PATCH] Avoiding the creation of a mouse listener per task instantiation. They were hogging the cpu when there are a lot of tasks. --- .../src/main/resources/web/js/ganttz/task.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/navalplanner-gantt-zk/src/main/resources/web/js/ganttz/task.js b/navalplanner-gantt-zk/src/main/resources/web/js/ganttz/task.js index 456bf24ad..7e48488c5 100755 --- a/navalplanner-gantt-zk/src/main/resources/web/js/ganttz/task.js +++ b/navalplanner-gantt-zk/src/main/resources/web/js/ganttz/task.js @@ -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) {