mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-03 07:06:23 +08:00
18 lines
415 B
CoffeeScript
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
|