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
|
||||
});
|
||||
|
||||
// Remove old hooks
|
||||
var hooks = document.getElementsByClassName('js-paloma-hook');
|
||||
|
||||
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);
|
||||
}
|
||||
var self = document.querySelector("[data-palomaid='" + id + "']");
|
||||
if (self) self.parentNode.removeChild(self);
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue