Files
RootPanel/core/static/script/layout/layout.coffee
2014-03-16 13:01:54 +08:00

18 lines
407 B
CoffeeScript

$ ->
$('nav a').each ->
$(this).parent().addClass('active') if $(this).attr('href') is location.pathname
$('#logout').on 'click', (e) ->
e.preventDefault()
$.ajax {
method: 'post'
url: '/account/logout/'
}
.done ->
location.href = '/'
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushError error