This commit is contained in:
Yudong
2014-05-16 22:55:56 +08:00
parent 5483ac3fcc
commit d023b4e9ef
5 changed files with 20 additions and 12 deletions

View File

@@ -14,4 +14,4 @@ $ ->
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'error', error
ErrorHandle.flushInfo 'alert', error

View File

@@ -2,7 +2,7 @@ $ ->
$('.signup-btn').on 'click', (e) ->
e.preventDefault()
if $('#passwd').val() isnt $('#passwd2').val()
ErrorHandle.flushInfo 'error', '两次密码不一致'
ErrorHandle.flushInfo 'alert', '两次密码不一致'
else
data =
username: $('#username').val()
@@ -17,4 +17,4 @@ $ ->
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'error', error
ErrorHandle.flushInfo 'alert', error

View File

@@ -14,4 +14,4 @@ $ ->
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'error', error
ErrorHandle.flushInfo 'alert', error

View File

@@ -17,4 +17,4 @@ $ ->
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'error', error
ErrorHandle.flushInfo 'alert', error

View File

@@ -1,7 +1,20 @@
$ ->
id = $('#ticketid').data 'id'
#return a promise
changeStatus = (status) ->
$.post '/ticket/update/', {
id: id
status: status
}
checkContent = ->
if $('#reply-content').val() is ''
console.log 's'
ErrorHandle.flushInfo 'alert', '回复不能为空'
return false
true
$('#reply-btn').on 'click', (e) ->
e.preventDefault()
return unless checkContent()
data = {
id: id
content: $('#reply-content').val()
@@ -18,13 +31,8 @@ $ ->
.fail (r) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'error', error
#return a promise
changeStatus = (status) ->
$.post '/ticket/update/', {
id: id
status: status
}
ErrorHandle.flushInfo 'alert', error
$('#close-btn').on 'click', (e) ->
e.preventDefault()