Sha256: ff028597113c4322805ec682af72f18c18a9d3168d5c5e0a1f40595f18af8edc

Contents?: true

Size: 1.4 KB

Versions: 78

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">
      <i class="icon fas fa-times fa-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

78 entries across 78 versions & 1 rubygems

Version Path
alchemy_cms-5.3.8 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.7 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.5 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.4 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.3 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.2 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.1 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.3.0 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.2.7 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.2.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.1.10 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.0.10 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.6.7 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.2.5 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.1.9 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.0.9 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-4.6.6 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.2.4 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee
alchemy_cms-5.1.8 app/assets/javascripts/alchemy/alchemy.image_overlay.coffee