function ContextualLinkClickTrait::toggleContextualTriggerVisibility

Same name in other branches
  1. 9 core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php \Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait::toggleContextualTriggerVisibility()
  2. 10 core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php \Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait::toggleContextualTriggerVisibility()
  3. 11.x core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php \Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait::toggleContextualTriggerVisibility()

Toggles the visibility of a contextual trigger.

Parameters

string $selector: The selector for the element that contains the contextual link.

6 calls to ContextualLinkClickTrait::toggleContextualTriggerVisibility()
ContextualLinkClickTrait::clickContextualLink in core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php
Clicks a contextual link.
ContextualLinksTest::testRevisionContextualLinks in core/modules/node/tests/src/FunctionalJavascript/ContextualLinksTest.php
Tests the contextual links on revisions.
LayoutBuilderDisableInteractionsTest::assertContextualLinkRetainsMouseup in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
Makes sure contextual links respond to mouseup event.
LayoutBuilderTest::clickContextualLink in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php
@todo Remove this in https://www.drupal.org/project/drupal/issues/2918718.
LayoutBuilderUiTest::testAddHighlights in core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
Tests that elements that open the dialog are properly highlighted.

... See full list

File

core/modules/contextual/tests/src/FunctionalJavascript/ContextualLinkClickTrait.php, line 45

Class

ContextualLinkClickTrait
Functions for testing contextual links.

Namespace

Drupal\Tests\contextual\FunctionalJavascript

Code

protected function toggleContextualTriggerVisibility($selector) {
    // Hovering over the element itself with should be enough, but does not
    // work. Manually remove the visually-hidden class.
    $this->getSession()
        ->executeScript("jQuery('{$selector} .contextual .trigger').toggleClass('visually-hidden');");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.