You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2013/09/06 18:39:31 UTC

[3/3] git commit: updated refs/heads/master to 8c8e5a4

Check if codemirror has already been added and remove


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8c8e5a46
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8c8e5a46
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8c8e5a46

Branch: refs/heads/master
Commit: 8c8e5a4671377563be6dcc942c976f9ae602c76a
Parents: 4eb2a38
Author: suelockwood <de...@gmail.com>
Authored: Fri Sep 6 11:56:42 2013 -0400
Committer: suelockwood <de...@gmail.com>
Committed: Fri Sep 6 11:56:42 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8c8e5a46/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 6b63c15..805116e 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -707,6 +707,9 @@ function(app, FauxtonAPI, Documents, pouchdb, Codemirror, JSHint, resizeColumns)
     afterRender: function() {
       this.model.on("sync", this.updateValues, this);
       var that = this;
+      if ($('.CodeMirror').length > 0){
+        $('.CodeMirror').remove();
+      }
       this.editor = Codemirror.fromTextArea(this.$el.find("textarea.doc-code").get()[0], {
         mode: "application/json",
         json: false,