mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Remove hook after execution
This commit is contained in:
parent
5e782c5bf7
commit
7b8cc9cac5
1 changed files with 2 additions and 9 deletions
|
@ -17,15 +17,8 @@
|
||||||
params: request.params
|
params: request.params
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove old hooks
|
var self = document.querySelector("[data-palomaid='" + id + "']");
|
||||||
var hooks = document.getElementsByClassName('js-paloma-hook');
|
if (self) self.parentNode.removeChild(self);
|
||||||
|
|
||||||
for (var i = 0, n = hooks.length; i < n; i++){
|
|
||||||
var hook = hooks[i],
|
|
||||||
palomaid = hook.dataset.palomaid.toString();
|
|
||||||
|
|
||||||
if (palomaid != id) hook.parentNode.removeChild(hook);
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue