Skip to content

Commit

Permalink
Correct podfile sidebar (#799)
Browse files Browse the repository at this point in the history
* Use Boostrap 5 classes for podfile folder sidebar

* minor correcttions on podfiles display

* Remove merge artifacts
  • Loading branch information
Badatos committed Apr 6, 2023
1 parent 2ff1500 commit dab8119
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pod/podfile/static/podfile/js/filewidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ if (typeof loaded == "undefined") {
bsdirs.hide();
});

document.querySelectorAll("#open-folder-icon > *").forEach((el) => {
/*document.querySelectorAll("#open-folder-icon > *").forEach((el) => {
el.style = "pointer-events: none; cursor : pointer;";
});
if (document.getElementById("open-folder-icon")) {
document.getElementById("open-folder-icon").style.cursor = "pointer";
}
}*/

document.addEventListener("click", (e) => {
/*document.addEventListener("click", (e) => {
if (
e.target.id != "open-folder-icon" &&
!e.target.matches("open-folder-icon i")
Expand All @@ -141,7 +141,7 @@ if (typeof loaded == "undefined") {
e.preventDefault();
document.getElementById("dirs").classList.add("open");
});
});*/

document.addEventListener("change", (e) => {
if (e.target.id != "ufile") return;
Expand All @@ -167,7 +167,7 @@ if (typeof loaded == "undefined") {
var data_form = new FormData(e.target);

var url = e.target.getAttribute("action");

fetch(url, {
method: "POST",
body: data_form,
Expand Down Expand Up @@ -701,7 +701,7 @@ if (typeof loaded == "undefined") {
foldname =
'<span class="folder_name" id="folder-name-' +
foldid +
'"> ' +
'">' +
foldname +
"</span>";
}
Expand Down
24 changes: 14 additions & 10 deletions pod/podfile/templates/podfile/home_content.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
{% load i18n %}

<div class="container-fluid h-100" id="podfile">
<div class="open-folder p-0" id="open-folder-icon">
<button class="navbar-toggler pod-navbar__button-toggler"
type="button"
aria-controls="dirs"
aria-expanded="false"
data-bs-toggle="collapse"
data-bs-target="#dirs"
title="{% trans 'Toggle folders menu' %}">
<i class="bi bi-list" aria-hidden="true"></i>
</button>
</div>
<div class="row">
<div class="col col-4" id="dirs">
<div class="col col-4 collapse collapse-horizontal" id="dirs">
{% include 'podfile/userfolder.html' %}
</div>
<div class="open-folder p-0" id="open-folder-icon">
<button class="navbar-toggler pod-navbar__button-toggler"
aria-controls="dirs"
data-bs-target="#dirs"
title="{% trans 'Toggle folders menu' %}">
<i class="bi bi-list" aria-hidden="true"></i>
</button>
</div>
<div class="col col-8 col-md-offset-1" id="files">

<div class="col" id="files">
{% include 'podfile/list_folder_files.html' with folder=current_session_folder %}
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion pod/podfile/templates/podfile/userfolder.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
{% trans "Add new folder" %}
</button>
</div>
<button id="close-folder-icon" type="button" class="btn-close" aria-label="{% trans 'Close' %}"></button>
<button id="close-folder-icon" type="button"
class="btn-close" aria-label="{% trans 'Close' %}"></button>
</div>
<label class="visually-hidden" for="folder-search">{% trans 'Search folder' %}</label>
<input
Expand Down

0 comments on commit dab8119

Please sign in to comment.