Fixing infinity loop issue
This commit is contained in:
parent
cea3a77b52
commit
0eea7f9373
@ -6,15 +6,15 @@ $.fn.tempShow = function(callback) {
|
|||||||
let current = this;
|
let current = this;
|
||||||
|
|
||||||
// Temporarily show all parent invisible elements until body
|
// Temporarily show all parent invisible elements until body
|
||||||
while (this.is(':hidden') && current !== document.body) {
|
while (this.is(':hidden')) {
|
||||||
const $element = this.parentsUntil(':visible').last();
|
const $element = $(current);
|
||||||
if (!$element.length) {
|
if (!$element.length || $element.is(':visible')) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$element.addClass('visible');
|
$element.addClass('visible');
|
||||||
current = $element[0];
|
|
||||||
elementsToHide.push(current);
|
elementsToHide.push(current);
|
||||||
|
current = $element[0].parentElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user