refactor(listeners) getLIElement: add early return

This commit is contained in:
coderaiser 2017-01-27 10:33:37 +02:00
parent cbad4f651e
commit e909c929b1

View file

@ -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;
}