fix confusing toast on F2 with nothing selected (#100)

This commit is contained in:
ed 2024-10-02 23:11:29 +00:00
parent dc157fa28f
commit 2715ee6c61

View file

@ -4622,13 +4622,13 @@ var fileman = (function () {
r.rename = function (e) {
ev(e);
if (clgot(bren, 'hide'))
return toast.err(3, L.fr_eperm);
var sel = msel.getsel();
if (!sel.length)
return toast.err(3, L.fr_emore);
if (clgot(bren, 'hide'))
return toast.err(3, L.fr_eperm);
var f = [],
base = vsplit(sel[0].vp)[0],
mkeys;
@ -4931,9 +4931,6 @@ var fileman = (function () {
r.delete = function (e) {
ev(e);
if (clgot(bdel, 'hide'))
return toast.err(3, L.fd_eperm);
var sel = msel.getsel(),
vps = [];
@ -4943,6 +4940,9 @@ var fileman = (function () {
if (!sel.length)
return toast.err(3, L.fd_emore);
if (clgot(bdel, 'hide'))
return toast.err(3, L.fd_eperm);
function deleter(err) {
var xhr = new XHR(),
vp = vps.shift();
@ -4980,14 +4980,14 @@ var fileman = (function () {
r.cut = function (e) {
ev(e);
if (clgot(bcut, 'hide'))
return toast.err(3, L.fc_eperm);
var sel = msel.getsel(),
vps = [];
if (!sel.length)
toast.err(3, L.fc_emore);
return toast.err(3, L.fc_emore);
if (clgot(bcut, 'hide'))
return toast.err(3, L.fc_eperm);
var els = [], griden = thegrid.en;
for (var a = 0; a < sel.length; a++) {
@ -5095,12 +5095,12 @@ var fileman = (function () {
};
r.paste = function () {
if (clgot(bpst, 'hide'))
return toast.err(3, L.fp_eperm);
if (!r.clip.length)
return toast.err(5, L.fp_ecut);
if (clgot(bpst, 'hide'))
return toast.err(3, L.fp_eperm);
var req = [],
exists = [],
indir = [],