Merge pull request #371 from humphd/thimble620

Fix https://github.com/mozilla/thimble.webmaker.org/issues/620 - Remember last-open-file within subdirs
This commit is contained in:
David Humphrey 2015-06-29 15:53:19 -04:00
Родитель 9fe83ec88c efcc4af140
Коммит 922b3a0353
3 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -190,7 +190,7 @@ define(function (require, exports, module) {
// XXXBramble: get path passed into iframe from hosting app // XXXBramble: get path passed into iframe from hosting app
ProjectManager.openProject(BrambleStartupState.project("root")).always(function () { ProjectManager.openProject(BrambleStartupState.project("root")).always(function () {
var deferred = new $.Deferred(); var deferred = new $.Deferred();
FileSystem.resolve(BrambleStartupState.project("fullPath"), function (err, file) { FileSystem.resolve(BrambleStartupState.project("filename"), function (err, file) {
if (!err) { if (!err) {
var promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: file.fullPath }); var promise = CommandManager.execute(Commands.CMD_ADD_TO_WORKINGSET_AND_OPEN, { fullPath: file.fullPath });
promise.then(deferred.resolve, deferred.reject); promise.then(deferred.resolve, deferred.reject);

Просмотреть файл

@ -319,12 +319,7 @@ define([
setReadyState(Bramble.MOUNTING); setReadyState(Bramble.MOUNTING);
root = Path.normalize(root); root = Path.normalize(root);
filename = filename || (_state.filename || "index.html"); filename = Path.resolve(root, filename || (_state.fullPath || "index.html"));
if (Path.isAbsolute(filename)) {
filename = Path.relative(root, filename);
debug("converted absolute filename path in mount() to relative", filename);
}
// Make sure the path we were given exists in the filesystem, and is a dir // Make sure the path we were given exists in the filesystem, and is a dir
_fs.stat(root, function(err, stats) { _fs.stat(root, function(err, stats) {

Просмотреть файл

@ -205,8 +205,7 @@ define(function (require, exports, module) {
// to Brackets that it can keep going, which will pick this up. // to Brackets that it can keep going, which will pick this up.
BrambleStartupState.project.init({ BrambleStartupState.project.init({
root: data.mount.root, root: data.mount.root,
filename: data.mount.filename, filename: data.mount.filename
fullPath: Path.join(data.mount.root, data.mount.filename)
}); });
// Set initial UI state values (if present) // Set initial UI state values (if present)