Throttle the drawing of the dependencies

If the dependencies have been drawn in the last 25 ms, they are not
redrawn.

FEA: ItEr75S08MigrationZK5
This commit is contained in:
Óscar González Fernández 2011-06-23 21:29:40 +02:00
parent 128342b8e8
commit c9761ef295

View file

@ -125,14 +125,17 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
return ganttz.DependencyComponentBase.$(dep);
});
});
var drawDependencies = common.Common.memoize(25, function() {
relatedDependencies().forEach(function(dependency) {
dependency.draw();
});
});
dragdropregion.on('dragEvent', this.proxy(function(ev) {
// Slight overload. It could be more efficent to overwrite the YUI
// method
// that is setting the top property
jq(this.$n()).css('top','');
relatedDependencies().forEach(function(dependency) {
dependency.draw();
});
drawDependencies();
}), null, false);
// Register the event endDragEvent
dragdropregion.on('endDragEvent', this.proxy(function(ev) {