Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/shepherd.js/src/js/utils/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import { isUndefined } from './type-check';
/**
* Sets up the handler to determine if we should advance the tour
* @param {string} selector
* @param {Step} step The step instance
* @return {Function}
* @private
*/
function _setupAdvanceOnHandler(selector, step) {
return (event) => {
if (step.isOpen()) {
const targetIsEl = step.el && event.currentTarget === step.el;
const targetIsSelector = !isUndefined(selector) && event.currentTarget.matches(selector);
if (targetIsSelector || targetIsEl) {
step.tour.next();
}
}
};
}
/**
* Bind the event handler for advanceOn
* @param {Step} step The step instance
*/
export function bindAdvance(step) {
// An empty selector matches the step element
const { event, selector } = step.options.advanceOn || {};
if (event) {
const handler = _setupAdvanceOnHandler(selector, step);
// TODO: this should also bind/unbind on show/hide
let el;
try {
el = document.querySelector(selector);
} catch (e) {
// TODO
}
if (!isUndefined(selector) && !el) {
return console.error(`No element was found for the selector supplied to advanceOn: ${selector}`);
} else if (el) {
el.addEventListener(event, handler);
step.on('destroy', () => {
return el.removeEventListener(event, handler);
});
} else {
document.body.addEventListener(event, handler, true);
step.on('destroy', () => {
return document.body.removeEventListener(event, handler, true);
});
}
} else {
return console.error('advanceOn was defined, but no event name was passed.');
}
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]-- |