summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarren Smith <garren.smith@gmail.com>2013-12-09 15:38:16 +0200
committerGarren Smith <garren.smith@gmail.com>2013-12-09 15:38:16 +0200
commitc26d71748d1e3f3c848d6ca0a8deff7b8bf3ffae (patch)
tree4a17a31787f92f3b3642ed11bb40f42b37ad895a
parent476845d4f9cdbcd120908d1c6c9f4d970ff10238 (diff)
downloadcouchdb-beforeunload.tar.gz
Clean up after viewbeforeunload
-rw-r--r--src/fauxton/app/api.js5
-rw-r--r--src/fauxton/app/modules/documents/views.js5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/fauxton/app/api.js b/src/fauxton/app/api.js
index b9ee8ea5f..751cdd2b3 100644
--- a/src/fauxton/app/api.js
+++ b/src/fauxton/app/api.js
@@ -63,10 +63,11 @@ function(app, Fauxton) {
FauxtonAPI.beforeUnload = function () {
app.router.beforeUnload.apply(app.router, arguments);
- }
+ };
+
FauxtonAPI.removeBeforeUnload = function () {
app.router.removeBeforeUnload.apply(app.router, arguments);
- }
+ };
FauxtonAPI.addHeaderLink = function(link) {
app.masterLayout.navBar.addLink(link);
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 7f3e80b42..64e304cdf 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1566,6 +1566,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb, resizeColum
//this.reduceEditor.setValue(this.langTemplates[this.defaultLang].reduce);
}
+ },
+
+ cleanup: function () {
+ this.mapEditor && this.mapEditor.remove();
+ this.reduceEditor && this.reduceEditor.remove();
}
});