-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[OPEN] Fix #4332 and #4409: Sort issues fixed on the Working Set and Project Tree #4463
Changes from all commits
a81d8c3
9331daf
f65acfe
49c48ba
121ab4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -485,14 +485,15 @@ define(function (require, exports, module) { | |
//(note: our actual jsTree theme CSS lives in brackets.less; we specify an empty .css | ||
// file because jsTree insists on loading one itself) | ||
sort : function (a, b) { | ||
var a1 = $(a).text(), | ||
b1 = $(b).text(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why you replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They aren't the same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, good to know they're not the same. |
||
|
||
// Windows: prepend folder names with a '0' and file names with a '1' so folders are listed first | ||
if (brackets.platform === "win") { | ||
// Windows: prepend folder names with a '0' and file names with a '1' so folders are listed first | ||
var a1 = ($(a).hasClass("jstree-leaf") ? "1" : "0") + this.get_text(a).toLowerCase(), | ||
b1 = ($(b).hasClass("jstree-leaf") ? "1" : "0") + this.get_text(b).toLowerCase(); | ||
return (a1 > b1) ? 1 : -1; | ||
} else { | ||
return this.get_text(a).toLowerCase() > this.get_text(b).toLowerCase() ? 1 : -1; | ||
a1 = ($(a).hasClass("jstree-leaf") ? "1" : "0") + a1; | ||
b1 = ($(b).hasClass("jstree-leaf") ? "1" : "0") + b1; | ||
} | ||
return FileUtils.compareFilenames(a1, b1, false); | ||
} | ||
}).bind( | ||
"before.jstree", | ||
|
@@ -764,6 +765,15 @@ define(function (require, exports, module) { | |
|
||
} | ||
|
||
/** | ||
* Forces createNewItem() to complete by removing focus from the rename field which causes | ||
* the new file to be written to disk | ||
*/ | ||
function forceFinishRename() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved due to a JSLint issue (used before defined) from a previous commit. |
||
$(".jstree-rename-input").blur(); | ||
} | ||
|
||
|
||
/** Returns the full path to the welcome project, which we open on first launch. | ||
* @private | ||
* @return {!string} fullPath reference | ||
|
@@ -824,7 +834,6 @@ define(function (require, exports, module) { | |
* project is loaded and tree is rendered, or rejected if the project path | ||
* fails to load. | ||
*/ | ||
|
||
function _loadProject(rootPath, isUpdating) { | ||
forceFinishRename(); // in case we're in the middle of renaming a file in the project | ||
|
||
|
@@ -1514,13 +1523,6 @@ define(function (require, exports, module) { | |
return result.promise(); | ||
} | ||
|
||
/** | ||
* Forces createNewItem() to complete by removing focus from the rename field which causes | ||
* the new file to be written to disk | ||
*/ | ||
function forceFinishRename() { | ||
$(".jstree-rename-input").blur(); | ||
} | ||
|
||
// Initialize variables and listeners that depend on the HTML DOM | ||
AppInit.htmlReady(function () { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Kind of hard to read and get it, but it looks nice and simple.