Files
RootPanel/core/static/script/base/ErrorHandle.coffee
2014-03-15 22:00:42 +08:00

19 lines
333 B
CoffeeScript

$ ->
window.ErrorHandle =
addError: (error) ->
$('#page-alert').append "<p>#{error}</p>"
clearError: ->
$('#page-alert').find('button').nextAll().remove()
showError: ->
$('#page-alert').show()
hideError: ->
$('#page-alert').hide()
flushError: (error) ->
@clearError()
@addError error
@showError()