Permalink
Browse files

Show Raw JSON button will not be displayed on older browsers without …

…an implementation of the JSON object.
  • Loading branch information...
1 parent 66394ec commit 9f4ff3ffbba9b1a06d6802125f27f7537dc8cc1b @Hillgod Hillgod committed Jun 16, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/es/widgets.js
View
@@ -1473,9 +1473,11 @@
_searchSource_handler: function(src) {
var searchSourceDiv = this.el.find("DIV.es-searchSource");
- var showRawJSON = $({ tag: "BUTTON", type: "button", text: "Show Raw JSON", id: "showRawJSON", value: JSON.stringify(src), onclick: this._showRawJSON });
searchSourceDiv.empty().append(new es.JsonPretty({ obj: src }));
- searchSourceDiv.append(showRawJSON);
+ if(typeof JSON !== "undefined") {
+ var showRawJSON = $({ tag: "BUTTON", type: "button", text: "Show Raw JSON", id: "showRawJSON", value: JSON.stringify(src), onclick: this._showRawJSON });
+ searchSourceDiv.append(showRawJSON);
+ }
searchSourceDiv.show();
},

0 comments on commit 9f4ff3f

Please sign in to comment.