Sha256: 54e4e3524e489054000833a03f95b2debed17c15a16d486d44fd0657837fa4b7
Contents?: true
Size: 1.43 KB
Versions: 2
Compression:
Stored size: 1.43 KB
Contents
I"¬(function() { window.dorsaleComments = { load: function() { return $("#dorsale-comments").map(function() { var container, url; container = $(this); url = this.dataset.url; return $.ajax({ url: url, success: function(data) { container.html(data); dorsaleComments.setupCreateForm(); dorsaleComments.setupEditButtons(); return dorsaleComments.setupDeleteButtons(); } }); }); }, reload: function() { return dorsaleComments.load(); }, setupCreateForm: function() { return $("#dorsale-comments form[id*=new]").on("ajax:success", dorsaleComments.reload); }, setupEditForm: function() { return $("#dorsale-comments form[id*=edit]").on("ajax:success", dorsaleComments.reload); }, setupEditButtons: function() { return $("#dorsale-comments [href$=edit]").click(function() { var container, url; container = $(this).parents(".comment"); url = this.href; $.ajax({ url: url, success: function(data) { container.replaceWith(data); return dorsaleComments.setupEditForm(); } }); return false; }); }, setupDeleteButtons: function() { return $("#dorsale-comments [data-method=delete]").on("ajax:success", dorsaleComments.reload); } }; }).call(this); :ET
Version data entries
2 entries across 2 versions & 1 rubygems