Sha256: 50e03fbc0c12cbd8d415efbeef917a7ae014f503ca3b1ac42edfdfbfe34511fc

Contents?: true

Size: 903 Bytes

Versions: 3

Compression:

Stored size: 903 Bytes

Contents

#= require ./simple_view

class Locomotive.Views.ApplicationView extends Locomotive.Views.SimpleView

  el: 'body'

  events:
    'click .navbar .navbar-toggle': 'slide_sidebar'

  initialize: ->
    @header_view  = new Locomotive.Views.Shared.HeaderView()
    @sidebar_view = new Locomotive.Views.Shared.SidebarView()
    @drawer_view  = new Locomotive.Views.Shared.DrawerView()

  render: ->
    super

    @sidebar_view.render()
    @drawer_view.render()

    @set_max_height()

    @automatic_max_height()

  slide_sidebar: (event) ->
    $('body').toggleClass('slide-right-sidebar')

  automatic_max_height: ->
    $(window).on 'resize', =>
      height = @set_max_height()
      PubSub.publish 'application_view.resize', height: height

  set_max_height: ->
    max_height  = $(window).height()
    height      = max_height - @header_view.height()

    @$('> .wrapper').height(height)

    height

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
locomotivecms-3.0.1 app/assets/javascripts/locomotive/views/application_view.js.coffee
locomotivecms-3.0.0 app/assets/javascripts/locomotive/views/application_view.js.coffee
locomotivecms-3.0.0.rc7 app/assets/javascripts/locomotive/views/application_view.js.coffee