mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-21 06:11:05 +08:00
27 lines
643 B
CoffeeScript
27 lines
643 B
CoffeeScript
$ ->
|
|
id = $('.row.content').data 'id'
|
|
|
|
$('.action-reply').click ->
|
|
$.post '/ticket/reply/', JSON.stringify
|
|
id: id
|
|
content: $('#reply-content').val()
|
|
.fail (jqXHR) ->
|
|
if jqXHR.responseJSON?.error
|
|
alert jqXHR.responseJSON.error
|
|
else
|
|
alert jqXHR.statusText
|
|
.success ->
|
|
location.reload()
|
|
|
|
$('.change-status').click ->
|
|
$.post '/ticket/update/', JSON.stringify
|
|
id: id
|
|
status: $(@).data 'status'
|
|
.fail (jqXHR) ->
|
|
if jqXHR.responseJSON?.error
|
|
alert jqXHR.responseJSON.error
|
|
else
|
|
alert jqXHR.statusText
|
|
.done ->
|
|
location.reload()
|