You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2011/08/16 03:09:13 UTC
svn commit: r1158078 -
/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
Author: hlship
Date: Tue Aug 16 01:09:12 2011
New Revision: 1158078
URL: http://svn.apache.org/viewvc?rev=1158078&view=rev
Log:
TAP5-1308: Only display the pop-up exception report dialog if the response content was text/html
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=1158078&r1=1158077&r2=1158078&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Tue Aug 16 01:09:12 2011
@@ -391,9 +391,13 @@ var Tapestry = {
Tapestry.debug(Tapestry.Messages.ajaxFailure + message, response);
- // Assuming here that it is text/html. Should we check?
+ var contentType = response.getResponseHeader("content-type")
- T5.ajax.showExceptionDialog(response.responseText)
+ var isHTML = contentType && (contentType.split(';')[0] === "text/html");
+
+ if (isHTML) {
+ T5.ajax.showExceptionDialog(response.responseText)
+ }
},
/**
@@ -1433,7 +1437,9 @@ Tapestry.ErrorPopup = Class.create({
var div = this.outerDiv;
- _.delay(function() { div.hide(); }, this.IE_FADE_TIME);
+ _.delay(function() {
+ div.hide();
+ }, this.IE_FADE_TIME);
return;
}