From c26d71748d1e3f3c848d6ca0a8deff7b8bf3ffae Mon Sep 17 00:00:00 2001 From: Garren Smith Date: Mon, 9 Dec 2013 15:38:16 +0200 Subject: Clean up after view --- src/fauxton/app/api.js | 5 +++-- src/fauxton/app/modules/documents/views.js | 5 +++++ 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(); } }); -- cgit v1.2.1