1
0
Fork 0
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:
kbparagua 2016-03-02 10:29:16 +08:00
parent 5e782c5bf7
commit 7b8cc9cac5

View file

@ -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>