Sha256: 3c5dc385506f8762f12871e45de3fd111924ce3d4331d5a981c7d47da02dc4e1

Contents?: true

Size: 594 Bytes

Versions: 3

Compression:

Stored size: 594 Bytes

Contents

Luca.concerns.ModalView = 
  closeOnEscape: true

  showOnInitialize: false

  backdrop: false

  __initializer: ()->
    @$el.addClass("modal")

    @on "before:render", applyModalConfig, @
    
    @

  container: ()->
    $('body')

  toggle: ()->
    @$el.modal('toggle')

  show: ()->
    @$el.modal('show')

  hide: ()->
    @$el.modal('hide')

applyModalConfig = ()->
  @$el.addClass 'modal'
  @$el.addClass 'fade' if @fade is true

  $('body').append( @$el )
  
  @$el.modal
    backdrop: @backdrop is true
    keyboard: @closeOnEscape is true
    show: @showOnInitialize is true

  @  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
luca-0.9.8 app/assets/javascripts/luca/concerns/modal_view.coffee
luca-0.9.76 src/concerns/modal_view.coffee
luca-0.9.7 src/concerns/modal_view.coffee