Sha256: f70743b2d6089b93eed536fbddb09968598d56b315c519f42b8d6be036cc7e23

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

App.Views.Common ||={}

class App.Views.Common.PopupWindow extends App.Views.Base
  initialize: (options)=>
    @content_view=options.view
    @width=options.width

    if typeof options.title isnt 'undefined'
      @title=options.title
    else
      @title=options.view.title

    if typeof options.showFooter isnt 'undefined'
      @showFooter=options.showFooter
    else
      @showFooter=false

    @template=JST['app/views/common/popup_window_template']
  render: =>
    $(@el).html @template()
    if @title
      @$('#myModalLabel').html(@title)
    if typeof @showFooter != 'undefined' and @showFooter is false
      @$('.modal-footer').remove()
    if typeof @width isnt 'undefined'
      @$('.modal').css('width',@width)
    else
      @$('.modal').css('width','580')

    @$('.modal-body').append @content_view.render().el

    @$('.cancel').on 'click', =>
      @$('#popmodal').modal('hide')

    $('body').append @.el

    @$('#popmodal').modal()

    @$('#popmodal').on 'hidden',=>
      @$('#popmodal').remove()

    @$('#popmodal').on 'shown',=>
      @content_view.afterRender()
    @
  afterRender: =>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_mongo_backbone_bootstrap_tmpl-0.0.3.1 template/app/assets/javascripts/app/views/common/popup_window.js.coffee
rails_mongo_backbone_bootstrap_tmpl-0.0.3 template/app/assets/javascripts/app/views/common/popup_window.js.coffee
rails_mongo_backbone_bootstrap_tmpl-0.0.2 template/app/assets/javascripts/app/views/common/popup_window.js.coffee