From 587bb6cd4c0f83532a7702868ee4e078d2030011 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Sat, 31 Jan 2015 13:37:18 -0300 Subject: [PATCH 1/2] Get rid of deprecated calls in LiveDevMultiBrowser --- src/LiveDevelopment/LiveDevMultiBrowser.js | 8 ++++---- src/document/DocumentManager.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/LiveDevelopment/LiveDevMultiBrowser.js b/src/LiveDevelopment/LiveDevMultiBrowser.js index 6852ea9118a..e076e487ff7 100644 --- a/src/LiveDevelopment/LiveDevMultiBrowser.js +++ b/src/LiveDevelopment/LiveDevMultiBrowser.js @@ -698,14 +698,14 @@ define(function (require, exports, module) { otherDocumentsInWorkingFiles; if (doc && !doc._masterEditor) { - otherDocumentsInWorkingFiles = DocumentManager.getWorkingSet().length; - DocumentManager.addToWorkingSet(doc.file); + otherDocumentsInWorkingFiles = MainViewManager.getWorkingSetSize(MainViewManager.ALL_PANES); + MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file); if (!otherDocumentsInWorkingFiles) { - DocumentManager.setCurrentDocument(doc); + MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc); } } - + // wait for server (StaticServer, Base URL or file:) prepareServerPromise .done(function () { diff --git a/src/document/DocumentManager.js b/src/document/DocumentManager.js index 653992214a5..b14bbe03b4a 100644 --- a/src/document/DocumentManager.js +++ b/src/document/DocumentManager.js @@ -157,7 +157,7 @@ define(function (require, exports, module) { * @return {Array.} */ function getWorkingSet() { - DeprecationWarning.deprecationWarning("Use MainViewManager.getViews() instead of DocumentManager.getWorkingSet()", true); + DeprecationWarning.deprecationWarning("Use MainViewManager.getWorkingSet() instead of DocumentManager.getWorkingSet()", true); return MainViewManager.getWorkingSet(MainViewManager.ALL_PANES) .filter(function (file) { // Legacy didn't allow for files with custom viewers From 86f94efe3f6a8e0e6f21776124628e641bc83588 Mon Sep 17 00:00:00 2001 From: Arzhan Kinzhalin Date: Thu, 5 Feb 2015 18:01:14 -0300 Subject: [PATCH 2/2] Use command instead of private method. --- src/LiveDevelopment/LiveDevMultiBrowser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LiveDevelopment/LiveDevMultiBrowser.js b/src/LiveDevelopment/LiveDevMultiBrowser.js index e076e487ff7..01fac227f39 100644 --- a/src/LiveDevelopment/LiveDevMultiBrowser.js +++ b/src/LiveDevelopment/LiveDevMultiBrowser.js @@ -71,7 +71,9 @@ define(function (require, exports, module) { var STATUS_RELOADING = exports.STATUS_RELOADING = 5; var STATUS_RESTARTING = exports.STATUS_RESTARTING = 6; - var Dialogs = require("widgets/Dialogs"), + var CommandManager = require("command/CommandManager"), + Commands = require("command/Commands"), + Dialogs = require("widgets/Dialogs"), DefaultDialogs = require("widgets/DefaultDialogs"), DocumentManager = require("document/DocumentManager"), EditorManager = require("editor/EditorManager"), @@ -702,7 +704,7 @@ define(function (require, exports, module) { MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file); if (!otherDocumentsInWorkingFiles) { - MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc); + CommandManager.execute(Commands.CMD_OPEN, { fullPath: doc.file.fullPath }); } }