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

Here are the bugfixes from the in-browser branch #1813

Merged
merged 1 commit into from
Oct 11, 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
1 change: 1 addition & 0 deletions src/command/KeyBindingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ define(function (require, exports, module) {
function (event) {
if (handleKey(_translateKeyboardEvent(event))) {
event.stopPropagation();
event.preventDefault();
}
},
true
Expand Down
7 changes: 1 addition & 6 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,7 @@ define(function (require, exports, module) {
var createWithSuggestedName = function (suggestedName) {
ProjectManager.createNewItem(baseDir, suggestedName, false, isFolder)
.pipe(deferred.resolve, deferred.reject, deferred.notify)
.always(function () { fileNewInProgress = false; })
.done(function (entry) {
if (!isFolder) {
FileViewController.addToWorkingSetAndSelect(entry.fullPath, FileViewController.PROJECT_MANAGER);
}
});
.always(function () { fileNewInProgress = false; });
};

deferred.done(createWithSuggestedName);
Expand Down
3 changes: 1 addition & 2 deletions src/file/FileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ define(function (require, exports, module) {
if (module && module.uri) {

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

// Remove module name from relative path. Remove trailing slash.
pathname = decodeURI(module.uri);
Expand Down
6 changes: 2 additions & 4 deletions src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,14 @@ define(function (require, exports, module) {
* @return {!string} fullPath reference
*/
function _getWelcomeProjectPath() {
var srcPath = decodeURI(window.location.pathname),
initialPath = srcPath.substr(0, srcPath.lastIndexOf("/")),
var initialPath = FileUtils.getNativeBracketsDirectoryPath(),
sampleUrl = Urls.GETTING_STARTED;
if (sampleUrl) {
// Back up one more folder. The samples folder is assumed to be at the same level as
// the src folder, and the sampleUrl is relative to the samples folder.
initialPath = initialPath.substr(0, initialPath.lastIndexOf("/")) + "/samples/" + sampleUrl;
}

initialPath = FileUtils.convertToNativePath(initialPath);
return initialPath;
}

Expand Down Expand Up @@ -960,7 +958,7 @@ define(function (require, exports, module) {
} else {
var errString = error.code === FileError.NO_MODIFICATION_ALLOWED_ERR ?
Strings.NO_MODIFICATION_ALLOWED_ERR :
StringUtils.format(String.GENERIC_ERROR, error.code);
StringUtils.format(Strings.GENERIC_ERROR, error.code);

var errMsg = StringUtils.format(Strings.ERROR_CREATING_FILE,
StringUtils.htmlEscape(data.rslt.name),
Expand Down