Sha256: 4c84adfcd77134a8f71c9ecdf07b7c4a44790cf0a5981a69b159a44454792d1a

Contents?: true

Size: 1.38 KB

Versions: 16

Compression:

Stored size: 1.38 KB

Contents

class window.Alchemy.ImageOverlay extends Alchemy.Dialog

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

  init: ->
    Alchemy.ImageLoader(@dialog_body[0])
    $('.zoomed-picture-background').on "click", (e) =>
      e.stopPropagation()
      return if e.target.nodeName == 'IMG'
      @close()
      false
    $('.picture-overlay-handle').on "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">
      <i class="icon ri-close-line ri-fw"></i>
    </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

16 entries across 16 versions & 1 rubygems

Version Path
alchemy_cms-7.1.12 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.11 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.10 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.9 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.8 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.7 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.5 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.4 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.3 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.0 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.0.pre.rc1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.0.pre.b2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-7.1.0.pre.b1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee