Files
RootPanel/core/static/script/layout/layout.coffee
Yudong d023b4e9ef fix
2014-05-16 22:55:56 +08:00

18 lines
415 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.flushInfo 'alert', error