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

Commit

Permalink
Merge pull request #1259 from adobe/tvoliter/issue-1028
Browse files Browse the repository at this point in the history
Alternative fix for issue #1028.
  • Loading branch information
redmunds committed Jul 17, 2012
2 parents 486afe2 + d4e81ba commit 4ef7fee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ define(function (require, exports, module) {
ProjectManager.createNewItem(baseDir, suggestedName, false)
.pipe(deferred.resolve, deferred.reject, deferred.notify)
.always(function () { fileNewInProgress = false; })
.done(function (entry) { FileViewController.addToWorkingSetAndSelect(entry.fullPath); });
.done(function (entry) {
FileViewController.addToWorkingSetAndSelect(entry.fullPath, FileViewController.PROJECT_MANAGER);
});
};

deferred.done(createWithSuggestedName);
Expand Down
6 changes: 4 additions & 2 deletions src/project/FileViewController.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ define(function (require, exports, module) {
* Opens the specified document if it's not already open, adds it to the working set,
* and selects it in the WorkingSetView
* @param {!fullPath}
* @param {?String} selectIn - specify either WORING_SET_VIEW or PROJECT_MANAGER.
* Default is WORING_SET_VIEW.
* @return {!$.Promise}
*/
function addToWorkingSetAndSelect(fullPath) {
function addToWorkingSetAndSelect(fullPath, selectIn) {
var result = new $.Deferred(),
promise = CommandManager.execute(Commands.FILE_ADD_TO_WORKING_SET, {fullPath: fullPath});

Expand All @@ -165,7 +167,7 @@ define(function (require, exports, module) {
promise.done(function (doc) {
// FILE_ADD_TO_WORKING_SET command sets the current document. Update the
// selection focus and trigger documentSelectionFocusChange event
_fileSelectionFocus = WORKING_SET_VIEW;
_fileSelectionFocus = selectIn ? selectIn : WORKING_SET_VIEW;
_selectCurrentDocument();

result.resolve(doc);
Expand Down

0 comments on commit 4ef7fee

Please sign in to comment.