Sha256: 86d7b3fd52cdeaca581221701d71afe03f0226e21bfe7f2dcb3309fe9f716de2

Contents?: true

Size: 952 Bytes

Versions: 6

Compression:

Stored size: 952 Bytes

Contents

window.enjoy_cms.gallery.gallery_loader = (target = "[data-enjoy-gallery-gallery-loader]")->
  $(document).delegate target, "click", (e)->
    e.preventDefault()

    link = $(e.currentTarget)
    url = link.attr('href')
    url = link.data("url") if !url or url == ""
    if url and url != ""
      $.get url, (data)->
        _target_selector = link.data("target-selector")
        if _target_selector and _target_selector != ""
          _target = $(_target_selector)
          if _target.length > 0
            if link.data("target-replace") == "true"
              _target.replaceWith(data)
            else
              _target.html(data)
            if link.data("loader-remove") == "true"
              link.remove()

        else
          if link.data("loader-insert-data") == "true"
            link.html(data)
          else
            link.replaceWith(data)

        window.enjoy_cms.gallery.construct_pages_selector()

    return false

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enjoy_cms_gallery-0.4.1 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee
enjoy_cms_gallery-0.4.0.2 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee
enjoy_cms_gallery-0.4.0.1 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee
enjoy_cms_gallery-0.4.0 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee
enjoy_cms_gallery-0.4.0.beta3 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee
enjoy_cms_gallery-0.4.0.beta1 app/assets/javascripts/enjoy/gallery/loaders/gallery_loader.coffee