From fb0d16afe26db29e1835fc26305328569172a98d Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Tue, 18 Jun 2013 10:23:44 -0400 Subject: [PATCH] Only show at most 300 chars in AJAX error notification --- cms/static/coffee/src/main.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cms/static/coffee/src/main.coffee b/cms/static/coffee/src/main.coffee index 5ac104d162..8043b41638 100644 --- a/cms/static/coffee/src/main.coffee +++ b/cms/static/coffee/src/main.coffee @@ -18,9 +18,13 @@ $ -> $(document).ajaxError (event, jqXHR, ajaxSettings, thrownError) -> if ajaxSettings.notifyOnError is false return + if jqXHR.responseText + message = _.str.truncate(jqXHR.responseText, 300) + else + message = gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.") msg = new CMS.Views.Notification.Error( "title": gettext("Studio's having trouble saving your work") - "message": jqXHR.responseText || gettext("This may be happening because of an error with our server or your internet connection. Try refreshing the page or making sure you are online.") + "message": message ) msg.show()