flush hooks right away
This commit is contained in:
parent
272d3ae9a2
commit
3d62979937
|
@ -28,15 +28,22 @@ module.exports = function(env) {
|
|||
|
||||
var flushHooksTimeout;
|
||||
|
||||
this.flushHooks = function() {
|
||||
clearTimeout(flushHooksTimeout);
|
||||
this.vm.stepping = true;
|
||||
var doFlushHooks = function() {
|
||||
this.vm.stepHooks = this.data.hooks.slice(0);
|
||||
if (this.vm.tab === 'real_time') m.redraw();
|
||||
setTimeout(function() {
|
||||
this.vm.stepping = false;
|
||||
this.vm.stepHooks = this.data.hooks.slice(0);
|
||||
}.bind(this);
|
||||
|
||||
this.flushHooks = function(now) {
|
||||
clearTimeout(flushHooksTimeout);
|
||||
if (now) doFlushHooks();
|
||||
else {
|
||||
this.vm.stepping = true;
|
||||
if (this.vm.tab === 'real_time') m.redraw();
|
||||
}.bind(this), 500);
|
||||
setTimeout(function() {
|
||||
this.vm.stepping = false;
|
||||
doFlushHooks();
|
||||
}.bind(this), 500);
|
||||
}
|
||||
flushHooksSchedule();
|
||||
}.bind(this);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ module.exports = function(send, ctrl) {
|
|||
var handlers = {
|
||||
hook_add: function(hook) {
|
||||
hookRepo.add(ctrl, hook);
|
||||
if (hook.action === 'cancel') ctrl.flushHooks();
|
||||
if (hook.action === 'cancel') ctrl.flushHooks(true);
|
||||
if (ctrl.vm.tab === 'real_time') m.redraw();
|
||||
},
|
||||
hook_remove: function(id) {
|
||||
|
|
Loading…
Reference in a new issue