mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
correct up2k mode in mixed-r/w
This commit is contained in:
parent
5148c4f2e9
commit
fc0c7ff374
|
@ -983,7 +983,8 @@ function apply_perms(perms) {
|
|||
(have_write || tds[a].getAttribute('data-perm') == 'read') ?
|
||||
'table-cell' : 'none';
|
||||
}
|
||||
if (!have_write && up2k)
|
||||
|
||||
if (window['up2k'])
|
||||
up2k.set_fsearch();
|
||||
}
|
||||
|
||||
|
@ -1021,5 +1022,8 @@ function reload_browser(not_mp) {
|
|||
widget.close();
|
||||
mp = init_mp();
|
||||
}
|
||||
|
||||
if (window['up2k'])
|
||||
up2k.set_fsearch();
|
||||
}
|
||||
reload_browser(true);
|
||||
|
|
|
@ -282,7 +282,7 @@ function up2k_init(have_crypto) {
|
|||
|
||||
var flag = false;
|
||||
apply_flag_cfg();
|
||||
apply_fsearch_cfg();
|
||||
set_fsearch();
|
||||
|
||||
function nav() {
|
||||
ebi('file' + fdom_ctr).click();
|
||||
|
@ -1061,12 +1061,24 @@ function up2k_init(have_crypto) {
|
|||
}
|
||||
|
||||
function tgl_fsearch() {
|
||||
fsearch = !fsearch;
|
||||
bcfg_set('fsearch', fsearch);
|
||||
apply_fsearch_cfg();
|
||||
set_fsearch(!fsearch);
|
||||
}
|
||||
|
||||
function apply_fsearch_cfg() {
|
||||
function set_fsearch(new_state) {
|
||||
var perms = document.body.getAttribute('perms');
|
||||
|
||||
if (!ebi('fsearch')) {
|
||||
new_state = false;
|
||||
}
|
||||
else if (perms && perms.indexOf('write') === -1) {
|
||||
new_state = true;
|
||||
}
|
||||
|
||||
if (new_state !== undefined) {
|
||||
fsearch = new_state;
|
||||
bcfg_set('fsearch', fsearch);
|
||||
}
|
||||
|
||||
try {
|
||||
var fun = fsearch ? 'add' : 'remove';
|
||||
ebi('op_up2k').classList[fun]('srch');
|
||||
|
@ -1078,11 +1090,6 @@ function up2k_init(have_crypto) {
|
|||
catch (ex) { }
|
||||
}
|
||||
|
||||
function set_fsearch() {
|
||||
if (!fsearch)
|
||||
tgl_fsearch();
|
||||
}
|
||||
|
||||
function tgl_flag_en() {
|
||||
flag_en = !flag_en;
|
||||
bcfg_set('flag_en', flag_en);
|
||||
|
@ -1131,12 +1138,8 @@ function up2k_init(have_crypto) {
|
|||
for (var a = nodes.length - 1; a >= 0; a--)
|
||||
nodes[a].addEventListener('touchend', nop, false);
|
||||
|
||||
var perms = document.body.getAttribute('perms');
|
||||
if (perms && perms.indexOf('write') === -1)
|
||||
set_fsearch();
|
||||
|
||||
set_fsearch();
|
||||
bumpthread({ "target": 1 })
|
||||
|
||||
return { "init_deps": init_deps, "set_fsearch": set_fsearch }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue