Skip to content

Commit

Permalink
some small fixups for path selector
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Nov 21, 2023
1 parent c1ca8e4 commit d023e0d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class PathSelectorTable {
const row = $(event.target).closest('tr').get(0) || event.target;
const url = row.dataset['apiUrl'];
const pathType = row.dataset['pathType'];
this.activateFavorite(row);

// only reload table for directories. and correct last visited
// if it's a file.
Expand All @@ -136,8 +137,19 @@ export class PathSelectorTable {
}
}

activateFavorite(currentlyClicked) {
$('li.active').each((_idx, ele) => {
ele.classList.remove('active');
});

if(currentlyClicked.tagName == "LI") {
currentlyClicked.classList.add('active');
}
}

clickBreadcrumb(event) {
const path = event.target.id;
this.activateFavorite(event.target);
this.reloadTable(path);
}

Expand Down Expand Up @@ -168,7 +180,9 @@ export class PathSelectorTable {
}

setLastVisited(path) {
localStorage.setItem(this.storageKey(), path);
if(path) {
localStorage.setItem(this.storageKey(), path);
}
}

initialUrl() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<li role='button'
class='clickable text-wrap list-group-item'
class='clickable text-wrap list-group-item list-group-item-action'
data-api-url=<%= files_path(path.to_s, fs: path.filesystem) %>>
<span class='fa fa-folder'>&nbsp;</span><%= path %>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
data-input-field-id="<%= input_field_id %>"
>

<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-path-selector-title">Select Your Working Directory</h5>
Expand Down

0 comments on commit d023e0d

Please sign in to comment.