Sha256: 10abb1ebff83a7bfe6cd11cdf0a2f66d5267663b60bb774c006cc22ce279c0c0
Contents?: true
Size: 1.23 KB
Versions: 6
Compression:
Stored size: 1.23 KB
Contents
I"á(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); this.setup(modal_html); return $(document).trigger("page:load"); }, close: function() { $(".modal").remove(); return $("body").removeClass("modal-open"); }, setup: function(scope) { scope = $(scope || document); return scope.find("a[data-modal=1], .modal-body a:not([data-modal=0])").click(function() { modal.open("Chargement..."); $.ajax({ url: this.href, dataType: "html", success: function(data) { return modal.open(data); }, error: function() { return modal.open("Erreur"); } }); return false; }); } }; $(document).on("ready page:load", function() { return modal.setup(); }); }).call(this); :ET
Version data entries
6 entries across 6 versions & 1 rubygems