summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuelockwood <deathbearbrown@gmail.com>2013-09-06 11:56:42 -0400
committersuelockwood <deathbearbrown@gmail.com>2013-09-06 11:56:42 -0400
commit8c8e5a4671377563be6dcc942c976f9ae602c76a (patch)
treeb680ebebe74c323c035d090cc44ddeb3f7ad7895
parent4eb2a38f28859bdfef8c7dd97a6456db708b48d7 (diff)
downloadcouchdb-8c8e5a4671377563be6dcc942c976f9ae602c76a.tar.gz
Check if codemirror has already been added and remove
-rw-r--r--src/fauxton/app/modules/documents/views.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 6b63c15b9..805116ee2 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,