Fixing infinity loop issue

This commit is contained in:
Bruno Alves de Faria 2017-11-08 08:38:36 -02:00
parent cea3a77b52
commit 0eea7f9373

View File

@ -6,15 +6,15 @@ $.fn.tempShow = function(callback) {
let current = this;
// Temporarily show all parent invisible elements until body
while (this.is(':hidden') && current !== document.body) {
const $element = this.parentsUntil(':visible').last();
if (!$element.length) {
while (this.is(':hidden')) {
const $element = $(current);
if (!$element.length || $element.is(':visible')) {
break;
}
$element.addClass('visible');
current = $element[0];
elementsToHide.push(current);
current = $element[0].parentElement;
}
if (typeof callback === 'function') {