Skip to content

Commit

Permalink
chore: add children with same depth to expanded path [BACKLOG-41878]
Browse files Browse the repository at this point in the history
  • Loading branch information
loonatic committed Oct 28, 2024
1 parent 341dcd1 commit c5354f4
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ define([
FileBrowser.openFolder = function (path) {
//first select folder
var $folder = $("[path='"+escapeCssSelector(path)+"']"),
$parentFolder = $folder.parent(".folders");
while(!$parentFolder.hasClass("body") && $parentFolder.length > 0){
$parentFolder.show();
$parentFolder.parent().addClass("open");
$parentFolder = $parentFolder.parent().parent();
$parentFolders = $folder.parent(".folders");
while(!$parentFolders.hasClass("body") && $parentFolders.length > 0){
$parentFolders.show();
$parentFolders.parent().addClass("open");
$parentFolders.parent().children(".element").attr("aria-expanded", true);
$parentFolders = $parentFolders.parent().parent();
}
$folder.find("> .element .name").trigger("click");
};
Expand Down Expand Up @@ -1180,11 +1181,12 @@ define([
$folder = myself.getFirstVisibleFolder();
}

var $parentFolder = $folder.parent(".folders");
while (!$parentFolder.hasClass("body") && $parentFolder.length > 0) {
$parentFolder.show();
$parentFolder.parent().addClass("open");
$parentFolder = $parentFolder.parent().parent();
var $parentFolders = $folder.parent(".folders");
while (!$parentFolders.hasClass("body") && $parentFolders.length > 0) {
$parentFolders.show();
$parentFolders.parent().addClass("open");
$parentFolders.parent().children(".element").attr("aria-expanded", true);
$parentFolders = $parentFolders.parent().parent();
}
FileBrowser.fileBrowserModel.set("clickedFolder", {
obj: $folder,
Expand All @@ -1203,6 +1205,7 @@ define([
$clickedFile.addClass("selected");
} else {
$folder.children(".element").attr("aria-expanded", true);
$folder.addClass("open");
$folder.addClass("selected");
$folder.children(".element").attr("tabindex", 0).attr("aria-selected", true);
$folder.find("> .folders").show();
Expand Down

0 comments on commit c5354f4

Please sign in to comment.