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

Alternative fix for issue #1028. #1259

Merged
merged 1 commit into from
Jul 17, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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