From 3f9cbffd7986cc5f42720ba38ca82c6424ba8916 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 4 Jun 2012 11:58:53 -0700 Subject: Adding lib copy blocking to preview This fixes an issue with launching preview before libraries were copied, hence, first time run would fail. Need to add a feedback screen for this process. --- js/document/models/base.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/document/models/base.js') diff --git a/js/document/models/base.js b/js/document/models/base.js index 76a5e62b..27f7d43f 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -103,7 +103,7 @@ exports.BaseDocumentModel = Montage.create(Component, { //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(function (result) { + this.saveAll(null,function (result) { //Currently only supporting current browser (Chrome, obviously) switch (this.browser) { case 'chrome': @@ -145,7 +145,7 @@ exports.BaseDocumentModel = Montage.create(Component, { //////////////////////////////////////////////////////////////////// // save: { - value: function (callback) { + value: function (callback, libCopyCallback) { // if (this.needsSave) { //Save @@ -165,7 +165,7 @@ exports.BaseDocumentModel = Montage.create(Component, { head: this.views.design.iframe.contentWindow.document.head, body: this.views.design.iframe.contentWindow.document.body, mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator - }, this.handleSaved.bind({callback: callback, model: this})); + }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); } else { //TODO: Add logic to save code view data } @@ -174,7 +174,7 @@ exports.BaseDocumentModel = Montage.create(Component, { //////////////////////////////////////////////////////////////////// // saveAll: { - value: function (callback) { + value: function (callback, libCopyCallback) { // if (this.needsSave) { //Save @@ -194,7 +194,7 @@ exports.BaseDocumentModel = Montage.create(Component, { head: this.views.design.iframe.contentWindow.document.head, body: this.views.design.iframe.contentWindow.document.body, mjsTemplateCreator: this.views.design.iframe.contentWindow.mjsTemplateCreator - }, this.handleSaved.bind({callback: callback, model: this})); + }, this.handleSaved.bind({callback: callback, model: this}), libCopyCallback); } else { //TODO: Add logic to save code view data } -- cgit v1.2.3