travis-web/assets/scripts/app/views/application.coffee
Piotr Sarnacki 4153c990be Fix specs
2012-10-15 23:20:33 +02:00

21 lines
716 B
CoffeeScript

@Travis.reopen
ApplicationView: Travis.View.extend
templateName: 'application'
classNames: ['application']
localeDidChange: (->
if locale = Travis.app.get('auth.user.locale')
Travis.setLocale(locale)
Travis.app.get('router').reload()
).observes('Travis.app.auth.user.locale')
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
if ! $(event.target).parents().andSelf().hasClass('popup')
@popupCloseAll()
if ! $(event.target).parents().andSelf().hasClass('menu')
$('.menu').removeClass('display')