1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-25 09:30:31 +00:00

Fix filemodal file selection dialog

This commit is contained in:
Anatolii Fetisov 2021-09-18 09:49:28 +03:00
parent 42ef049b63
commit 781ca7a3f3

View File

@ -652,10 +652,10 @@ $(function() {
var folder = target.data("folderonly"); var folder = target.data("folderonly");
var filter = target.data("filefilter"); var filter = target.data("filefilter");
$("#element_selected").text(path); $("#element_selected").text(path);
$("#file_confirm")[0].attributes["data-link"].value = target.data("link"); $("#file_confirm").data("link", target.data("link"));
$("#file_confirm")[0].attributes["data-folderonly"].value = (typeof folder === 'undefined') ? false : true; $("#file_confirm").data("folderonly", (typeof folder === 'undefined') ? false : true);
$("#file_confirm")[0].attributes["data-filefilter"].value = (typeof filter === 'undefined') ? "" : filter; $("#file_confirm").data("filefilter", (typeof filter === 'undefined') ? "" : filter);
$("#file_confirm")[0].attributes["data-newfile"].value = target.data("newfile"); $("#file_confirm").data("newfile", target.data("newfile"));
fillFileTable(path,"dir", folder, filter); fillFileTable(path,"dir", folder, filter);
}); });
@ -669,7 +669,7 @@ $(function() {
var folder = $(file_confirm).data("folderonly"); var folder = $(file_confirm).data("folderonly");
var filter = $(file_confirm).data("filefilter"); var filter = $(file_confirm).data("filefilter");
var newfile = $(file_confirm).data("newfile"); var newfile = $(file_confirm).data("newfile");
if (newfile !== 'undefined') { if (newfile !== "") {
$("#element_selected").text(path + $("#new_file".text())); $("#element_selected").text(path + $("#new_file".text()));
} else { } else {
$("#element_selected").text(path); $("#element_selected").text(path);