mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Remove jquery on hook
This commit is contained in:
parent
e9cf4e9aff
commit
8ac945ce96
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
<% id = "#{Time.now.to_i}#{(rand * 1000).ceil}" %>
|
<% id = "#{Time.now.to_i}#{(rand * 1000).ceil}" %>
|
||||||
|
|
||||||
<div class="js-paloma-hook" data-id="<%= id %>">
|
<div class="js-paloma-hook" data-palomaid="<%= id %>">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(){
|
(function(){
|
||||||
// Do not continue if Paloma not found.
|
// Do not continue if Paloma not found.
|
||||||
|
@ -11,7 +11,10 @@
|
||||||
Paloma.env = '<%= Rails.env %>';
|
Paloma.env = '<%= Rails.env %>';
|
||||||
|
|
||||||
// Remove any callback details if any
|
// Remove any callback details if any
|
||||||
$('.js-paloma-hook[data-id!=' + <%= id %> + ']').remove();
|
var hook =
|
||||||
|
document.querySelector("[data-palomaid='" + <%= id %> + "']")[0];
|
||||||
|
|
||||||
|
if (hook) hook.parentNode.removeChild(hook);
|
||||||
|
|
||||||
var request = <%= request.to_json.html_safe %>;
|
var request = <%= request.to_json.html_safe %>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue