Sha256: ac763bb12e623dc9955e45534c3137f1ce9b77c5f582d70b670e8f5592e9fd3f
Contents?: true
Size: 1.06 KB
Versions: 17
Compression:
Stored size: 1.06 KB
Contents
<script type="application/javascript"> (function (id_button, container_selector) { var element = $(id_button)[0]; // in modalità ajax, utilizzando le chimate di rails, facciamo in modo di attendere gli eventi <% if ajax_remove? %> element.onclick = function (e) { $(element).on("ajax:success", function (event) { element.kono_utils_delete_container(); }).on("ajax:error", function (event) { console.error("Destroy problems", arguments, event.detail[0]); $(container_selector).trigger("error_during_container_deletion", [container_selector, event.detail[0], event]); }); }; <% else %> element.onclick = function (e) { e.preventDefault(); this.kono_utils_delete_container(); }; <%end %> element.kono_utils_delete_container = function () { $(container_selector).hide().find('[type="hidden"][name$="[_destroy]"]').val('true'); $(container_selector).trigger("container_deleted", [$(container_selector)[0]]); } })("#<%= unique_dom_id %>", '#<%= remove_target %>'); </script>
Version data entries
17 entries across 17 versions & 1 rubygems