Rename memoize to throttle
It represents better the purpose of the function. FEA: ItEr75S08MigrationZK5
This commit is contained in:
parent
5af60d8d37
commit
eb207f6eb4
2 changed files with 3 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ common.Common = zk.$extends(zk.Widget,{},{
|
|||
|
||||
webAppContextPath : function(){ return window.location.pathname.split( '/' )[1];},
|
||||
|
||||
memoize: function(timeoutTimeMillis, functionToExecute) {
|
||||
throttle: function(timeoutTimeMillis, functionToExecute) {
|
||||
var lastTimeCalled = null;
|
||||
var cachedResult = null;
|
||||
return function() {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
|
|||
_addDragDrop : function(){
|
||||
var dragdropregion = this._getDragDropRegion();
|
||||
var thisTaskId = this.$n().id;
|
||||
var relatedDependencies = common.Common.memoize(3000, function() {
|
||||
var relatedDependencies = common.Common.throttle(3000, function() {
|
||||
return jq('.dependency[idtaskorig='+ thisTaskId + ']')
|
||||
.add('.dependency[idtaskend='+ thisTaskId + ']')
|
||||
.get()
|
||||
|
|
@ -125,7 +125,7 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
|
|||
return ganttz.DependencyComponentBase.$(dep);
|
||||
});
|
||||
});
|
||||
var drawDependencies = common.Common.memoize(25, function() {
|
||||
var drawDependencies = common.Common.throttle(25, function() {
|
||||
relatedDependencies().forEach(function(dependency) {
|
||||
dependency.draw();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue