Merge pull request #406 from syrk4web/dev

fix file manager dropdown
This commit is contained in:
Théophile Diot 2023-01-19 08:39:09 +01:00 committed by GitHub
commit 12b4cfa226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -185,12 +185,9 @@ class FolderDropdown {
if (
e.target.closest("div").hasAttribute(`${this.prefix}-action-button`)
) {
const att = e.target
.closest("div")
.getAttribute(`${this.prefix}-action-button`);
const dropEl = document.querySelector(
`[${this.prefix}-action-dropdown="${att}"]`
);
const dropEl = e.target
.closest(`div[${this.prefix}-element]`)
.querySelector(`[${this.prefix}-action-dropdown]`);
//avoid multiple dropdown
if (prevActionBtn === "") prevActionBtn = dropEl;
if (prevActionBtn !== dropEl) this.hideDropEls();
@ -557,7 +554,7 @@ class FolderModal {
getInfoFromActionBtn(btnEl) {
const action = btnEl.getAttribute("value");
const name = btnEl.getAttribute(`${this.prefix}-action-dropdown-btn`);
const folder = document.querySelector(`[${this.prefix}-element='${name}']`);
const folder = btnEl.closest(`[${this.prefix}-element]`);
const level = folder.getAttribute("level");
const path = folder.getAttribute("path");
const type = folder.getAttribute("_type");