src/LiveDevelopment/LiveDevMultiBrowser.js
function open() {
        // TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
        // doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
        _getInitialDocFromCurrent().done(function (doc) {
            var prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(),
                otherDocumentsInWorkingFiles;

            if (doc && !doc._masterEditor) {
                otherDocumentsInWorkingFiles = MainViewManager.getWorkingSetSize(MainViewManager.ALL_PANES);
                MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file);

                if (!otherDocumentsInWorkingFiles) {
                    CommandManager.execute(Commands.CMD_OPEN, { fullPath: doc.file.fullPath });
                }
            }

            // wait for server (StaticServer, Base URL or file:)
            prepareServerPromise
                .done(function () {
                    _setStatus(STATUS_CONNECTING);
                    _doLaunchAfterServerReady(doc);
                })
                .fail(function () {
                    _showWrongDocError();
                });
        });
    }
function open() {
        // TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
        // doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
        _getInitialDocFromCurrent().done(function (doc) {
            var prepareServerPromise = (doc && _prepareServer(doc)) || new $.Deferred().reject(),
                otherDocumentsInWorkingFiles;

            if (doc && !doc._masterEditor) {
                otherDocumentsInWorkingFiles = MainViewManager.getWorkingSetSize(MainViewManager.ALL_PANES);
                MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, doc.file);

                if (!otherDocumentsInWorkingFiles) {
                    CommandManager.execute(Commands.CMD_OPEN, { fullPath: doc.file.fullPath });
                }
            }

            // wait for server (StaticServer, Base URL or file:)
            prepareServerPromise
                .done(function () {
                    _setStatus(STATUS_CONNECTING);
                    _doLaunchAfterServerReady(doc);
                })
                .fail(function () {
                    _showWrongDocError();
                });
        });
    }
function open ( ) { // TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange // doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc... _getInitialDocFromCurrent ( ) . done ( function ( doc ) { var prepareServerPromise = ( doc && _prepareServer ( doc ) ) || new $ . Deferred ( ) . reject ( ) , otherDocumentsInWorkingFiles ; if ( doc && ! doc . _masterEditor ) { otherDocumentsInWorkingFiles = MainViewManager . getWorkingSetSize ( MainViewManager . ALL_PANES ) ; MainViewManager . addToWorkingSet ( MainViewManager . ACTIVE_PANE , doc . file ) ; if ( ! otherDocumentsInWorkingFiles ) { CommandManager . execute ( Commands . CMD_OPEN , { fullPath : doc . file . fullPath } ) ; } } // wait for server (StaticServer, Base URL or file:) prepareServerPromise . done ( function ( ) { _setStatus ( STATUS_CONNECTING ) ; _doLaunchAfterServerReady ( doc ) ; } ) . fail ( function ( ) { _showWrongDocError ( ) ; } ) ; } ) ; }
Open a live preview on the current docuemnt.
Open a live preview on the current docuemnt .