MCPcopy
hub / github.com/shipshapecode/shepherd / _styleTargetElementForStep

Method _styleTargetElementForStep

shepherd.js/src/step.ts:777–802  ·  view source on GitHub ↗

* Modulates the styles of the passed step's target element, based on the step's options and * the tour's `modal` option, to visually emphasize the element * * @param {Step} step The step object that attaches to the element * @private

(step: Step)

Source from the content-addressed store, hash-verified

775 * @private
776 */
777 _styleTargetElementForStep(step: Step) {
778 const targetElement = step.target;
779 const extraHighlightElements = step._resolvedExtraHighlightElements;
780
781 if (!targetElement) {
782 return;
783 }
784
785 const highlightClass = step.options.highlightClass;
786 if (highlightClass) {
787 targetElement.classList.add(highlightClass);
788 extraHighlightElements?.forEach((el) => el.classList.add(highlightClass));
789 }
790
791 targetElement.classList.remove('shepherd-target-click-disabled');
792 extraHighlightElements?.forEach((el) =>
793 el.classList.remove('shepherd-target-click-disabled')
794 );
795
796 if (step.options.canClickTarget === false) {
797 targetElement.classList.add('shepherd-target-click-disabled');
798 extraHighlightElements?.forEach((el) =>
799 el.classList.add('shepherd-target-click-disabled')
800 );
801 }
802 }
803
804 /**
805 * When a step is hidden, remove the highlightClass and 'shepherd-enabled'

Callers 1

_showMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected