Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit e233fbb

Browse files
committed
Merge pull request #9373 from adobe/jeff/wsv-drag-final
Working Set Draggable
2 parents 4cc43b3 + 017c464 commit e233fbb

9 files changed

Lines changed: 960 additions & 307 deletions

File tree

src/document/DocumentCommandHandlers.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,13 @@ define(function (require, exports, module) {
244244
* @param {!string} fullPath
245245
* @param {boolean=} silent If true, don't show error message
246246
* @param {string=} paneId, the id oi the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE.
247+
* @param {{*}=} options, command options
247248
* @return {$.Promise} a jQuery promise that will either
248249
* - be resolved with a file for the specified file path or
249250
* - be rejected with FileSystemError if the file can not be read.
250251
* If paneId is undefined, the ACTIVE_PANE constant
251252
*/
252-
function _doOpen(fullPath, silent, paneId) {
253+
function _doOpen(fullPath, silent, paneId, options) {
253254
var result = new $.Deferred();
254255

255256
// workaround for https://github.com/adobe/brackets/issues/6001
@@ -288,7 +289,7 @@ define(function (require, exports, module) {
288289
});
289290

290291
var file = FileSystem.getFileForPath(fullPath);
291-
MainViewManager._open(paneId, file)
292+
MainViewManager._open(paneId, file, options)
292293
.done(function () {
293294
result.resolve(file);
294295
})
@@ -314,10 +315,11 @@ define(function (require, exports, module) {
314315
* @param {?string} fullPath - The path of the file to open; if it's null we'll prompt for it
315316
* @param {boolean=} silent - If true, don't show error message
316317
* @param {string=} paneId - the pane in which to open the file. Can be undefined, a valid pane id or ACTIVE_PANE
318+
* @param {{*}=} options - options to pass to MainViewManager._open
317319
* @return {$.Promise} a jQuery promise resolved with a Document object or
318320
* rejected with an err
319321
*/
320-
function _doOpenWithOptionalPath(fullPath, silent, paneId) {
322+
function _doOpenWithOptionalPath(fullPath, silent, paneId, options) {
321323
var result;
322324
paneId = paneId || MainViewManager.ACTIVE_PANE;
323325
if (!fullPath) {
@@ -341,7 +343,7 @@ define(function (require, exports, module) {
341343
});
342344
MainViewManager.addListToWorkingSet(paneId, filesToOpen);
343345

344-
_doOpen(paths[paths.length - 1], silent, paneId)
346+
_doOpen(paths[paths.length - 1], silent, paneId, options)
345347
.done(function (file) {
346348
_defaultOpenDialogFullPath =
347349
FileUtils.getDirectoryPath(
@@ -357,7 +359,7 @@ define(function (require, exports, module) {
357359
}
358360
});
359361
} else {
360-
result = _doOpen(fullPath, silent, paneId);
362+
result = _doOpen(fullPath, silent, paneId, options);
361363
}
362364

363365
return result.promise();
@@ -414,9 +416,11 @@ define(function (require, exports, module) {
414416
paneId = (commandData && commandData.paneId) || MainViewManager.ACTIVE_PANE,
415417
result = new $.Deferred();
416418

417-
_doOpenWithOptionalPath(fileInfo.path, silent, paneId)
419+
_doOpenWithOptionalPath(fileInfo.path, silent, paneId, commandData && commandData.options)
418420
.done(function (file) {
419-
MainViewManager.setActivePaneId(paneId);
421+
if (!commandData || !commandData.options || !commandData.options.noPaneActivate) {
422+
MainViewManager.setActivePaneId(paneId);
423+
}
420424

421425
// If a line and column number were given, position the editor accordingly.
422426
if (fileInfo.line !== null) {

src/editor/EditorManager.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,10 @@ define(function (require, exports, module) {
554554
// show the view
555555
pane.showView(document._masterEditor);
556556

557-
// give it focus
558-
document._masterEditor.focus();
557+
if (MainViewManager.getActivePaneId() === pane.id) {
558+
// give it focus
559+
document._masterEditor.focus();
560+
}
559561

560562
if (createdNewEditor) {
561563
_restoreEditorViewState(document._masterEditor);

src/htmlContent/working-set.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="{{id}}">
1+
<div class="working-set-view" id="{{id}}">
22
<div class="working-set-header"><span class="working-set-header-title">{{WORKING_FILES}}</span></div>
33
<div class="open-files-container">
44
<!-- This will contain runtime-generated <li>'s for each file in the working set -->

0 commit comments

Comments
 (0)