mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
refactor(listeners) getLIElement: add early return
This commit is contained in:
parent
cbad4f651e
commit
e909c929b1
1 changed files with 6 additions and 4 deletions
|
|
@ -316,16 +316,18 @@ var Util, DOM, CloudFunc, CloudCmd;
|
|||
}
|
||||
|
||||
function getLIElement(element) {
|
||||
if (element)
|
||||
while (element.tagName !== 'LI')
|
||||
element = element.parentElement;
|
||||
if (!element)
|
||||
return element;
|
||||
|
||||
while (element.tagName !== 'LI')
|
||||
element = element.parentElement;
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
function getULElement(element) {
|
||||
while (element.tagName !== 'UL')
|
||||
element = element.parentElement;
|
||||
element = element.parentElement;
|
||||
|
||||
return element;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue