Sha256: 52c5d98df2d2a9283fe96f7cf818efe2496a342ba1dd2cbaded3568dbd68531d

Contents?: true

Size: 1.45 KB

Versions: 6

Compression:

Stored size: 1.45 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);
      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;
      });
    }
  };

  $(document).on("ready page:load", function() {
    return modal.setup();
  });

}).call(this);
:ET

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dorsale-2.6.3 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache
dorsale-2.6.2 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache
dorsale-2.6.1 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache
dorsale-2.6.0 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache
dorsale-2.5.0 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache
dorsale-2.4.3 spec/dummy/tmp/cache/assets/development/sprockets/v3.0/V9PTh28r0zYeuTBp8ebHZjitftynz_H6MIgsn8upmOA.cache