Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/pages/fileBrowser/fileBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,16 +929,16 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
return;
}

let action = $el.getAttribute("action") || $el.dataset.action;
let action = $el.dataset.action;
if (!action) return;

let url = $el.dataset.url;
let name = $el.dataset.name || $el.getAttribute("name");
const idOpenDoc = $el.hasAttribute("open-doc");
const uuid = $el.getAttribute("uuid");
const type = $el.getAttribute("type");
const storageType = $el.getAttribute("storageType");
const home = $el.getAttribute("home");
let name = $el.dataset.name;
const isOpenDoc = $el.dataset.openDoc != null;
const uuid = $el.dataset.uuid;
const type = $el.dataset.type;
const storageType = $el.dataset.storageType;
const home = $el.dataset.home;
const isDir = ["dir", "directory", "folder"].includes(type);

if (!url) {
Expand All @@ -960,7 +960,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
return;
}

if (!url && action === "open" && isDir && !idOpenDoc && !isContextMenu) {
if (!url && action === "open" && isDir && !isOpenDoc && !isContextMenu) {
loader.hide();
util.addPath(name, uuid).then((res) => {
const storage = allStorages.find((storage) => storage.uuid === uuid);
Expand All @@ -975,7 +975,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
}

if (isContextMenu) action = "contextmenu";
else if (idOpenDoc) action = "open-doc";
else if (isOpenDoc) action = "openDoc";

switch (action) {
case "navigation":
Expand All @@ -988,7 +988,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
if (isDir) folder();
else if (!$el.hasAttribute("disabled")) file();
break;
case "open-doc":
case "openDoc":
openDoc();
break;
}
Expand Down Expand Up @@ -1046,7 +1046,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
if (appSettings.value.vibrateOnTap) {
navigator.vibrate(config.VIBRATION_TIME);
}
if ($el.getAttribute("open-doc") === "true") return;
if (isOpenDoc) return;

const deleteText =
currentDir.url === "/" ? strings.remove : strings.delete;
Expand Down Expand Up @@ -1399,7 +1399,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {

if (IS_FILE_MODE) {
util.pushFolder(allStorages, "Select document", null, {
"open-doc": true,
openDoc: true,
});
}

Expand Down Expand Up @@ -1646,7 +1646,7 @@ function FileBrowserInclude(mode, info, doesOpenLast = true) {
className="nav"
data-url={url}
data-name={displayName}
attr-action="navigation"
data-action="navigation"
attr-text={displayName}
tabIndex={-1}
></span>,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/fileBrowser/fileBrowser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}

.tile {
&[storageType="notification"] {
&[data-storage-type="notification"] {
background-color: rgb(153, 153, 255);
background-color: var(--primary-color);
color: rgb(255, 255, 255);
Expand All @@ -22,11 +22,11 @@
position: relative;
color: rgb(65, 85, 133);

&[storageType]::after {
&[data-storage-type]::after {
position: absolute;
top: 50%;
left: 50%;
content: attr(storageType);
content: attr(data-storage-type);
transform: translate(-50%, -50%);
color: rgb(255, 255, 255);
font-size: 0.6rem;
Expand Down
18 changes: 9 additions & 9 deletions src/pages/fileBrowser/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<li
tabindex="1"
class="tile {{#isLink}}symlink{{/isLink}}"
action="open"
type="{{type}}"
name="{{name}}"
{{#home}}home="{{.}}"{{/home}}
{{#open-doc}}open-doc="true"{{/open-doc}}
{{#ftp-account}}ftp-account{{/ftp-account}}
data-action="open"
data-type="{{type}}"
data-name="{{name}}"
{{#home}}data-home="{{.}}"{{/home}}
{{#openDoc}}data-open-doc{{/openDoc}}
{{#ftpAccount}}data-ftp-account{{/ftpAccount}}
{{#uuid}}data-uuid="{{uuid}}"{{/uuid}}
{{#storageType}}data-storage-type="{{.}}"{{/storageType}}
{{#disabled}}disabled{{/disabled}}
{{#uuid}}uuid="{{uuid}}"{{/uuid}}
{{#storageType}}storageType="{{.}}"{{/storageType}}
>
<span
class="icon {{icon}} {{#uuid}}user-added-storage{{/uuid}}"
{{#storageType}}storageType="{{.}}"{{/storageType}}
{{#storageType}}data-storage-type="{{.}}"{{/storageType}}
></span>

<div class="text">
Expand Down