aboutsummaryrefslogtreecommitdiffstats
path: root/loggedin.js
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-02-15 13:07:49 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-02-15 13:07:49 +0200
commitb6ad2bd2f2a65e069261c4e8b26df94b7cbf7d24 (patch)
tree64138eb4a6cd08c67fa07762743023662216da97 /loggedin.js
parent3948a723fd68a195582910845fee85282bc2b278 (diff)
downloadfileup-b6ad2bd2f2a65e069261c4e8b26df94b7cbf7d24.tar.gz
Close button for windows
Diffstat (limited to 'loggedin.js')
-rw-r--r--loggedin.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/loggedin.js b/loggedin.js
index effc880..c7be090 100644
--- a/loggedin.js
+++ b/loggedin.js
@@ -816,11 +816,17 @@ function download_file(in_file, filename) {
// make_window creates an explorer window - the kind that can list directories/open files
-function make_window(pwd) {
+function make_window(pwd, has_close) {
var wnd = make_window_base(pwd, 100, 100, 800, 600);
path = mk(wnd.h2, 'div', 'path');
+ if (has_close) {
+ var x_button = mk(wnd.h2, 'button', 'close_button');
+ x_button.innerText = "X";
+ x_button.onclick = delete_window;
+ }
+
// wnd.foldercontents is where the FileViews will be stored
// it also has a subheader (h3) with 'Upload' and 'New FOlder' buttons
{
@@ -917,7 +923,7 @@ function add_file_visuals(fileview) {
['Open in New Window', () => {
var new_pwd = focus.pwd.slice();
new_pwd.push(fileview.filename);
- var new_wnd = make_window(new_pwd);
+ var new_wnd = make_window(new_pwd, true);
focus_window(new_wnd);
openfile(fileview.is_directory);
}],