From 7b30d028115b6061cca6291ce2dcddf292ab849a Mon Sep 17 00:00:00 2001 From: Jochen Hagenstroem Date: Wed, 18 Sep 2013 16:48:55 -0700 Subject: [PATCH 1/2] fix 5110: ensure _doLaunchAfterServerReady uses the document that was current when the GoLive command --- src/LiveDevelopment/LiveDevelopment.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index 7b210836bb2..75d5ceea3b5 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -974,12 +974,12 @@ define(function LiveDevelopment(require, exports, module) { // helper function that actually does the launch once we are sure we have // a doc and the server for that doc is up and running. - function _doLaunchAfterServerReady() { + function _doLaunchAfterServerReady(doc) { // update status _setStatus(STATUS_CONNECTING); // create live document - _liveDocument = _createDocument(_getCurrentDocument(), EditorManager.getCurrentFullEditor()); + _liveDocument = _createDocument(doc, EditorManager.getCurrentFullEditor()); // start listening for requests _server.add(_liveDocument); @@ -1042,7 +1042,10 @@ define(function LiveDevelopment(require, exports, module) { prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(); // wait for server (StaticServer, Base URL or file:) - prepareServerPromise.done(_doLaunchAfterServerReady); + prepareServerPromise.done(function(result){ + _doLaunchAfterServerReady(doc); + }); + prepareServerPromise.fail(function () { _showWrongDocError(); _openDeferred.reject(); From f2a105ccd6a5b587dfa714ad3aa8a86cecb61f66 Mon Sep 17 00:00:00 2001 From: Jochen Hagenstroem Date: Thu, 19 Sep 2013 11:39:50 -0700 Subject: [PATCH 2/2] fix jslint errors --- src/LiveDevelopment/LiveDevelopment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LiveDevelopment/LiveDevelopment.js b/src/LiveDevelopment/LiveDevelopment.js index 75d5ceea3b5..2b0c26fe628 100644 --- a/src/LiveDevelopment/LiveDevelopment.js +++ b/src/LiveDevelopment/LiveDevelopment.js @@ -1042,8 +1042,8 @@ define(function LiveDevelopment(require, exports, module) { prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(); // wait for server (StaticServer, Base URL or file:) - prepareServerPromise.done(function(result){ - _doLaunchAfterServerReady(doc); + prepareServerPromise.done(function (result) { + _doLaunchAfterServerReady(doc); }); prepareServerPromise.fail(function () {