Skip to content
Snippets Groups Projects
Commit 92b83444 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

replace setTimeout and clearTimeout handling by _.debounce

parent ec572607
Branches
No related tags found
No related merge requests found
......@@ -41,14 +41,9 @@ UserManagementFilter.prototype.init = function() {
//besides the keys, the value must have been changed compared to last
//time
if(valid && umf.oldVal !== umf.getPattern()) {
clearTimeout(umf.thread);
umf.thread = setTimeout(
function() {
umf.run();
},
300
);
umf.run();
}
umf.oldVal = umf.getPattern();
});
};
......@@ -57,12 +52,15 @@ UserManagementFilter.prototype.init = function() {
* @brief the filter action needs to be done, here the accurate steps are being
* taken care of
*/
UserManagementFilter.prototype.run = function() {
this.userList.empty();
this.userList.update(GroupList.getCurrentGID());
this.groupList.empty();
this.groupList.update();
};
UserManagementFilter.prototype.run = _.debounce(function() {
console.log(this);
this.userList.empty();
this.userList.update(GroupList.getCurrentGID());
this.groupList.empty();
this.groupList.update();
},
300
);
/**
* @brief returns the filter String
......@@ -82,4 +80,4 @@ UserManagementFilter.prototype.addResetButton = function(button) {
umf.filterInput.val('');
umf.run();
});
};
\ No newline at end of file
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment