From 1b8586c07951accbc3c0f3951966e4e258b0c5d9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 4 Jun 2012 15:34:57 -0700 Subject: Adding saving blocking screen This is for chrome preview, also fixed other preview bug with plain files not opening in preview. --- js/document/models/base.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'js/document/models') diff --git a/js/document/models/base.js b/js/document/models/base.js index 27f7d43f..0957145a 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -99,11 +99,20 @@ exports.BaseDocumentModel = Montage.create(Component, { //////////////////////////////////////////////////////////////////// //TODO: Add API to allow other browser support browserPreview: { - value: function (browser) { + value: function (browser, screen, context) { + //Making call to show feedback screen + if (screen) screen.show(context); //Generating URL for document var url = this.application.ninja.coreIoApi.rootUrl + this.file.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]; //TODO: Add logic to prompt user to save (all) before preview - this.saveAll(null,function (result) { + this.saveAll(null,function (success) { + //Making call to show feedback screen + if (screen) screen.hide(context); + //TODO: Add error handling logic + if (!success) { + console.log('Error!'); + return; + } //Currently only supporting current browser (Chrome, obviously) switch (this.browser) { case 'chrome': -- cgit v1.2.3