travis-web/assets/scripts/app/views/application.coffee
Randy Morgan e4fb6c1fee Completed dynamic I18n intetegration.
travis-web starts in English. When the user logs in, it switches to
their locale, when they logout, it goes back to english.
2012-12-11 10:48:19 +09:00

25 lines
792 B
CoffeeScript

@Travis.reopen
ApplicationView: Travis.View.extend
templateName: 'layouts/home'
classNames: ['application']
connectLayout: (name) ->
name = "layouts/#{name}"
if @get('templateName') != name
@set('templateName', name)
@rerender()
# popup: (event) ->
# console.log event
click: (event) ->
# TODO: this solves the case of closing menus and popups,
# but I would like to rewrite it later, not sure how
# yet, but this does not seem optimal
targetAndParents = $(event.target).parents().andSelf()
if ! ( targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup') )
@popupCloseAll()
if ! targetAndParents.hasClass('menu')
$('.menu').removeClass('display')