Sha256: 417f2b794dc23ec3e334888b20b9631ea4ed83e50127d2940c97754fc7a708c5
Contents?: true
Size: 1.5 KB
Versions: 6
Compression:
Stored size: 1.5 KB
Contents
I"ð(function() { $(function() { window.modal = { open: function(content) { var modal_html; this.close(); $("body").addClass("modal-open"); modal_html = $("<div class='modal'> <div class='modal-overlay'></div> <button class='modal-close'></button> <div class='modal-body'>" + content + "</div> </div>"); modal_html.find(".modal-overlay, .modal-close").click(function() { return modal.close(); }); $("body").append(modal_html); return this.setup(modal_html); }, close: function() { $(".modal").remove(); return $("body").removeClass("modal-open"); }, setup: function(scope) { scope = $(scope || document); scope.find("a[data-modal=1], .modal-body a:not([data-modal=0])").click(function() { modal.open("Chargement..."); $.get(this.href, function(data) { return modal.open(data); }); return false; }); return scope.find("form[data-modal=1], .modal-body form:not([data-modal=0])").submit(function() { $.ajax({ url: this.action, type: this.method.toUpperCase(), data: $(this).serialize(), success: function(data) { return flash(data); }, error: function() { return flash("Erreur"); } }); return false; }); } }; return modal.setup(); }); }).call(this); :ET
Version data entries
6 entries across 6 versions & 1 rubygems