aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-14 09:57:53 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-14 09:57:53 +0200
commit379d7db3628a46889ae52d69296e2a8a610d32b4 (patch)
treee0bbec4c8dd55d555314a68aaee40d50d4a65674
parente42f26d37a4afee40b49aa7c1357695656acfd6c (diff)
downloadfileup-379d7db3628a46889ae52d69296e2a8a610d32b4.tar.gz
Close button for share window
-rw-r--r--css/style.css14
-rw-r--r--loggedin.js19
2 files changed, 28 insertions, 5 deletions
diff --git a/css/style.css b/css/style.css
index abce858..619c4d8 100644
--- a/css/style.css
+++ b/css/style.css
@@ -403,7 +403,11 @@ input[type=submit]:hover {
align-self: center;
}
-.pathentry:hover {
+.pathentry:last-child {
+ cursor: inherit;
+}
+
+.pathentry:not(:last-child):hover {
text-decoration: underline;
}
@@ -453,3 +457,11 @@ input[type=submit]:hover {
background: white;
background: rgba(255,255,255, 0.9);
}
+
+.window > h2 .close_button {
+ border-left: 1px solid #ccc;
+}
+
+.close_button:hover {
+ background: white;
+}
diff --git a/loggedin.js b/loggedin.js
index d54bdb6..4ada47d 100644
--- a/loggedin.js
+++ b/loggedin.js
@@ -428,8 +428,10 @@ function drop_handler(dst, src) {
function add_link_functionality(link, length) {
link.onclick = (e) => {
- focus.pwd.length = length,
+ if (length < focus.pwd.length) {
+ focus.pwd.length = length;
openfile(true);
+ }
}
link.onmouseup = (e) => {
@@ -525,8 +527,18 @@ function mkcheckbox(parent, label, togglefn) {
function make_share_window(folder, filename) {
var wnd = make_window_base(null, 400, 400, 400, 0);
- wnd.h2.innerText = "Share " + filename;
- wnd.h2.style.padding = "0.2rem 0.4rem";
+ wnd.h2.style.padding = "0.0rem 0rem 0.0rem 0.8rem";
+ wnd.h2.style.display = 'flex';
+
+ var heading = mk(wnd.h2, 'span');
+ heading.innerText = "Share " + filename;
+ heading.style.display = 'flex';
+ heading.style.alignItems = 'center';
+ heading.style.flex = "1 1 0";
+
+ var x_button = mk(wnd.h2, 'button', 'close_button');
+ x_button.innerText = "X";
+ x_button.onclick = delete_window;
wnd.foldercontents = mk(wnd.visuals, 'div', 'share_dialog_contents');
wnd.foldercontents.style.padding = "0.5rem";
@@ -755,7 +767,6 @@ function add_file_visuals(fileview) {
);
}
context_list.push(
- ['Share', () => { share(false, fileview.filename); }],
['Delete', () => { move_to_trash(fileview.filename); }]
);
}