From 919a0d0ed35c24b1047281723ddde2ac98fc9a3e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 15 May 2012 22:36:44 -0700 Subject: document close handler. initial working draft Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 26 ++++---------------------- js/document/html-document.js | 39 --------------------------------------- js/document/models/base.js | 3 ++- 3 files changed, 6 insertions(+), 62 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 9bbea4c9..87c776d5 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -42,13 +42,6 @@ exports.HtmlDocument = Montage.create(Component, { // exclusionList: { value: ["HTML", "BODY"] //TODO: Update to correct list - }, - //////////////////////////////////////////////////////////////////// - // - uuid: { - get: function() { - return this._uuid; - } }, //////////////////////////////////////////////////////////////////// // @@ -133,21 +126,10 @@ exports.HtmlDocument = Montage.create(Component, { //////////////////////////////////////////////////////////////////// // closeDocument: { - value: function () { - // - this.model.close(null, this.handleCloseDocument.bind(this)); - } - }, - //////////////////////////////////////////////////////////////////// - // - handleCloseDocument: { - value: function (success) { - //TODO: Add logic for handling success or failure - // - this.application.ninja.documentController._documents.splice(this.uuid, 1); - // - NJevent("closeDocument", this.model.file.uri); - //TODO: Delete object here + value: function (context, callback) { + var closed = this.model.close(null); + + callback.call(context, this); } }, //////////////////////////////////////////////////////////////////// diff --git a/js/document/html-document.js b/js/document/html-document.js index 9d083dd8..6a84abdf 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -971,45 +971,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { this.application.ninja.undocontroller.redoQueue = this.redoStack.slice(0); - } - }, - //////////////////////////////////////////////////////////////////// - /** - *pause videos on switching or closing the document, so that the browser does not keep downloading the media data - */ - pauseVideos:{ - value:function(){ - var videosArr = this.documentRoot.getElementsByTagName("video"), i=0; - for(i=0;i