mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
chore(dom) deleteCurrent: es2015-ify
This commit is contained in:
parent
e92f791c81
commit
5cfd640131
1 changed files with 5 additions and 15 deletions
|
|
@ -933,29 +933,19 @@ function CmdProto() {
|
|||
*
|
||||
*/
|
||||
this.deleteCurrent = (current) => {
|
||||
var next, prev, currentNew;
|
||||
|
||||
if (!current)
|
||||
Cmd.getCurrentFile();
|
||||
|
||||
var parent = current && current.parentElement;
|
||||
var name = Cmd.getCurrentName(current);
|
||||
const parent = current && current.parentElement;
|
||||
const name = Cmd.getCurrentName(current);
|
||||
|
||||
if (current && name !== '..') {
|
||||
next = current.nextSibling,
|
||||
prev = current.previousSibling;
|
||||
|
||||
if (next)
|
||||
currentNew = next;
|
||||
else if (prev)
|
||||
currentNew = prev;
|
||||
|
||||
DOM.setCurrentFile(currentNew);
|
||||
const next = current.nextSibling;
|
||||
const prev = current.previousSibling;
|
||||
|
||||
DOM.setCurrentFile(next || prev);
|
||||
parent.removeChild(current);
|
||||
}
|
||||
|
||||
return currentNew;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue