Sha256: 6d18f47af6a62ade79d30765d32f4bd0c3190571d06770f538191418bc753bcb

Contents?: true

Size: 1.4 KB

Versions: 31

Compression:

Stored size: 1.4 KB

Contents

class window.Alchemy.ImageOverlay extends Alchemy.Dialog

  constructor: (url) ->
    @options =
      draggable: false
    super(url, @options)
    return

  init: ->
    Alchemy.ImageLoader(@dialog_body)
    $('.zoomed-picture-background').click (e) =>
      e.stopPropagation()
      return if e.target.nodeName == 'IMG'
      @close()
      false
    $('.picture-overlay-handle').click (e) =>
      @dialog.toggleClass('hide-form')
      false
    @$previous = $('.previous-picture')
    @$next = $('.next-picture')
    @$document.keydown (e) =>
      return true if e.target.nodeName == 'INPUT'
      switch e.which
        when 37
          @previous()
          false
        when 39
          @next()
          false
        else
          true
    super()

  previous: ->
    @$previous.click()
    return

  next: ->
    @$next.click()
    return

  build: ->
    @dialog_container = $('<div class="alchemy-image-overlay-container" />')
    @dialog = $('<div class="alchemy-image-overlay-dialog" />')
    @dialog_body = $('<div class="alchemy-image-overlay-body" />')
    @close_button = $('<a class="alchemy-image-overlay-close">
      <span class="icon close small"></span>
    </a>')
    @dialog.append(@close_button)
    @dialog.append(@dialog_body)
    @dialog_container.append(@dialog)
    @overlay = $('<div class="alchemy-image-overlay" />')
    @$body.append(@overlay)
    @$body.append(@dialog_container)
    @dialog

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.7 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.5 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.4 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.3 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.5 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.4 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.0 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.3 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.0.rc2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.0.rc1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.0.0.beta app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.6.0 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.5.0 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-3.4.2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee