Commit 5c8a90dc authored by Leonardo Menezes's avatar Leonardo Menezes
Browse files

fix rest format button

parent 931c40f9
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -990,9 +990,11 @@ function AceEditor(target) {
  // formats the json content
  this.format = function() {
    try {
      var content = this.editor.getValue();
      this.editor.setValue(content, 0);
      var content = this.getValue();
      if (content) {
        this.editor.setValue(JSON.stringify(content, undefined, 2), 0);
        this.editor.gotoLine(0, 0, false);
      }
    } catch (error) { // nothing to do
    }
  };
+5 −3
Original line number Diff line number Diff line
@@ -27,9 +27,11 @@ function AceEditor(target) {
  // formats the json content
  this.format = function() {
    try {
      var content = this.editor.getValue();
      this.editor.setValue(content, 0);
      var content = this.getValue();
      if (content) {
        this.editor.setValue(JSON.stringify(content, undefined, 2), 0);
        this.editor.gotoLine(0, 0, false);
      }
    } catch (error) { // nothing to do
    }
  };