Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showIndicatorIds,
hideIndicatorIds,
newRoot,
);
}
// Update the DOM with the new shown state and finished indicators.
updateRoot(newRoot);
};
if (delay === 0) {
// If there's no delay, show target immediately without showing/hiding
// any indicators.
showElement();
} else {
// If there's a delay, first trigger the indicators before the show.
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then show the target.
later(delay)
.then(showElement)
.catch(showElement);
}
},
};
showIndicatorIds,
hideIndicatorIds,
newRoot,
);
}
// Update the DOM with the new toggle state and finished indicators.
updateRoot(newRoot);
};
if (delay === 0) {
// If there's no delay, toggle immediately without showing/hiding
// any indicators.
toggleElement();
} else {
// If there's a delay, first trigger the indicators before the toggle.
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then toggle the target.
later(delay)
.then(toggleElement)
.catch(toggleElement);
}
},
};
showIndicatorIds,
hideIndicatorIds,
newRoot,
);
}
// Update the DOM with the new hidden state and finished indicators.
updateRoot(newRoot);
};
if (delay === 0) {
// If there's no delay, hide target immediately without showing/hiding
// any indicators.
hideElement();
} else {
// If there's a delay, first trigger the indicators before the hide
const newRoot = Behaviors.setIndicatorsBeforeLoad(
showIndicatorIds,
hideIndicatorIds,
getRoot(),
);
// Update the DOM to reflect the new state of the indicators.
updateRoot(newRoot);
// Wait for the delay then hide the target.
later(delay)
.then(hideElement)
.catch(hideElement);
}
},
};