Forráskód Böngészése

Alert when Ajax requests on individual records fail 'ajaxError'

Markus Ochel 12 éve
szülő
commit
ad8b2f4a16
2 módosított fájl, 4 hozzáadás és 1 törlés
  1. 1 1
      admin/controllers/index.coffee
  2. 3 0
      admin/lib/spine-couch-ajax.coffee

+ 1 - 1
admin/controllers/index.coffee

@@ -127,7 +127,7 @@ class App extends Spine.Controller
 
     # Alert user when leaving the application.
     window.onbeforeunload = (e) ->
-      msg = 'Leaving Kleks now, but you may have unsaved items. Keep going if you are sure.'
+      msg = 'Bye bye! Leaving Kleks now, but you may have unsaved items. Keep going if you are sure.'
       e = window.event if not e?
       e.returnValue = msg if e
       msg

+ 3 - 0
admin/lib/spine-couch-ajax.coffee

@@ -207,6 +207,9 @@ class Singleton extends Base
     (xhr, statusText, error) =>
       @record.trigger('ajaxError', xhr, statusText, error)
       options.error?.apply(@record)
+      
+      # Popup an alert box that we could communicate with server
+      alert "Could NOT communicate with server for \"#{@record.title or @record.name}\".\n\nCheck your connection and try again."
 
 # CouchAjax endpoint
 Model.host = ''