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

Commit 36a8a03

Browse files
committed
Merge pull request #1813 from jdiehl/bugfixes-from-in-browser
Here are the bugfixes from the in-browser branch
2 parents 8475ebe + 86e391d commit 36a8a03

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

src/command/KeyBindingManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ define(function (require, exports, module) {
483483
function (event) {
484484
if (handleKey(_translateKeyboardEvent(event))) {
485485
event.stopPropagation();
486+
event.preventDefault();
486487
}
487488
},
488489
true

src/document/DocumentCommandHandlers.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,7 @@ define(function (require, exports, module) {
343343
var createWithSuggestedName = function (suggestedName) {
344344
ProjectManager.createNewItem(baseDir, suggestedName, false, isFolder)
345345
.pipe(deferred.resolve, deferred.reject, deferred.notify)
346-
.always(function () { fileNewInProgress = false; })
347-
.done(function (entry) {
348-
if (!isFolder) {
349-
FileViewController.addToWorkingSetAndSelect(entry.fullPath, FileViewController.PROJECT_MANAGER);
350-
}
351-
});
346+
.always(function () { fileNewInProgress = false; });
352347
};
353348

354349
deferred.done(createWithSuggestedName);

src/file/FileUtils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,7 @@ define(function (require, exports, module) {
241241
if (module && module.uri) {
242242

243243
// Remove window name from base path. Maintain trailing slash.
244-
pathname = decodeURI(window.location.pathname);
245-
path = convertToNativePath(pathname.substr(0, pathname.lastIndexOf("/") + 1));
244+
path = getNativeBracketsDirectoryPath() + "/";
246245

247246
// Remove module name from relative path. Remove trailing slash.
248247
pathname = decodeURI(module.uri);

src/project/ProjectManager.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,16 +623,14 @@ define(function (require, exports, module) {
623623
* @return {!string} fullPath reference
624624
*/
625625
function _getWelcomeProjectPath() {
626-
var srcPath = decodeURI(window.location.pathname),
627-
initialPath = srcPath.substr(0, srcPath.lastIndexOf("/")),
626+
var initialPath = FileUtils.getNativeBracketsDirectoryPath(),
628627
sampleUrl = Urls.GETTING_STARTED;
629628
if (sampleUrl) {
630629
// Back up one more folder. The samples folder is assumed to be at the same level as
631630
// the src folder, and the sampleUrl is relative to the samples folder.
632631
initialPath = initialPath.substr(0, initialPath.lastIndexOf("/")) + "/samples/" + sampleUrl;
633632
}
634633

635-
initialPath = FileUtils.convertToNativePath(initialPath);
636634
return initialPath;
637635
}
638636

@@ -960,7 +958,7 @@ define(function (require, exports, module) {
960958
} else {
961959
var errString = error.code === FileError.NO_MODIFICATION_ALLOWED_ERR ?
962960
Strings.NO_MODIFICATION_ALLOWED_ERR :
963-
StringUtils.format(String.GENERIC_ERROR, error.code);
961+
StringUtils.format(Strings.GENERIC_ERROR, error.code);
964962

965963
var errMsg = StringUtils.format(Strings.ERROR_CREATING_FILE,
966964
StringUtils.htmlEscape(data.rslt.name),

0 commit comments

Comments
 (0)