Open modal

@param string $selector

@return this
193598
public function modal(String $selector)
    {
        $this->settings['attr']['data-toggle'] = 'modal';
        $this->settings['attr']['data-target'] = Base::prefix($selector, '#');

        return $this;
    }
335299
public function serializer(String $url, $selector = '.modal-body', $datatype = 'standart')
    {
        $selector = is_string($selector)
                  ? ($this->settings['attr']['data-target'] ?? NULL) . Base::prefix($selector, ' ')
                  : $selector;

        return $this->trigger('click', $url, $selector, $datatype, 'serializer');
    }
243510
public function openTag($tagName)
    {
        $this->append(sprintf('<%s', $tagName));
        $this->tag = $tagName;

        return $this;
    }
798856
public function detach(string $selector = null): NodeList {
        if (!is_null($selector)) {
            $nodes = $this->find($selector, 'self::');
        } else {
            $nodes = $this->collection();
        }

        $nodeList = $this->newNodeList();

        $nodes->each(function($node) use($nodeList) {
            if ($node->parent() instanceof \DOMNode) {
                $nodeList[] = $node->parent()->removeChild($node);
            }
        });

        $nodes->fromArray([]);

        return $nodeList;
    }
987393
private function convertToParagraph(string $selector): self {
        $nodes = $this->document()->find($selector);

        foreach ($nodes as $node) {
            $tagNodes = $node->find('a, blockquote, dl, div, img, ol, p, pre, table, ul');

            if (!$tagNodes->count()) {
                $this->replaceElementsWithPara($node);
            } else {
                $replacements = $this->getReplacementNodes($node);

                $node->contents()->remove();
                $node->append($replacements);
            }
        }

        return $this;
    }
952977
public function selector($selector)
    {
        if( is_scalar($selector) )
        {
            $this->selector = json_encode($selector);
        }
        else
        {
            $this->selector = Buffering\Callback::do($selector);
        }
        

        return $this;
    }
1336251
function (selector) {
        selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);

        return selector.find(this);
      }
456014
protected static function getSelectorParts($selector)
    {
        $firstOpen = strpos($selector, '[');
        if ($firstOpen === false) {
            return array( $selector, '' );
        }
        $firstClose  = strpos($selector, ']');
        $container   = substr($selector, 0, $firstOpen);
        $subselector = substr($selector, $firstOpen + 1, $firstClose - $firstOpen - 1) . substr(
            $selector,
            $firstClose + 1
        );

        return array( $container, $subselector );
    }
768554
public function registerPopover($selector = 'body', $options = array())
    {
        TbArray::defaultValue('selector', 'a[rel=popover]', $options);
        $this->registerPlugin(self::PLUGIN_POPOVER, $selector, $options);
    }
949652
public function filter($selector)
    {
        $result = $this->createChildInstance();

        if ($this->length > 0) {
            if (\is_callable($selector)) {
                foreach ($this->nodes as $index => $node) {
                    if ($selector($node, $index)) {
                        $result->addDomNode($node);
                    }
                }
            } else {
                $selection = self::create($this->document)->find($selector);

                foreach ($selection as $result_node) {
                    foreach ($this->nodes as $node) {
                        if ($result_node->isSameNode($node)) {
                            $result->addDomNode($node);
                            break 1;
                        }
                    }
                }
            }
        }

        return $result;
    }
712794
public function click($selector = null)
    {
        if (is_null($selector)) {
            (new WebDriverActions($this->driver))->click()->perform();
        } else {
            $this->resolver->findOrFail($selector)->click();
        }

        return $this;
    }
387988
public function mapWithIndex(callable $selector): Observable
    {
        $index = 0;
        return $this->map(function ($value) use ($selector, &$index) {
            return $selector($index++, $value);
        });
    }
167333
public function toggleField($selector = '.jsToggleField', $widget = 'JBZoo.FieldToggle', array $options = [])
    {
        $this->jqueryFactory();

        $this->Html->script('Core.admin/widget/field-toggle.js', $this->_setOptions([
            'alias'  => __FUNCTION__,
            'weight' => self::WEIGHT_WIDGET
        ]));

        $options = Hash::merge(['token' => $this->request->getCookie('csrfToken')], $options);
        $this->Js->widget($selector, $widget, $options);

        return $this;
    }
827675
public function siblings($selector=null)
    {
        $result = $this->createChildInstance();

        if (isset($this->document) && $this->length > 0) {
            foreach ($this->nodes as $node) {
                if ($node->parentNode) {
                    foreach ($node->parentNode->childNodes as $sibling) {
                        if ($sibling instanceof \DOMElement && !$sibling->isSameNode($node)) {
                            $result->addDomNode($sibling);
                        }
                    }
                }
            }

            if ($selector) {
                $result = $result->filter($selector);
            }
        }

        return $result;
    }
159754
public function assertSeeIn($selector, $text)
    {
        $fullSelector = $this->resolver->format($selector);

        $element = $this->resolver->findOrFail($selector);

        PHPUnit::assertTrue(
            Str::contains($element->getText(), $text),
            "Did not see expected text [{$text}] within element [{$fullSelector}]."
        );

        return $this;
    }
527353
public function branchPopup($js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $modal = new OpenModalDialogCommand(t('Select location'), $this->buildPopupContent(FALSE), $this->popupOptions());
      $response->addCommand($modal);
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }
364734
public function parent($selector = null) {
        $results = $this->_walkPathUntil('parentNode', null, $selector, self::$MATCH_TYPE_FIRST);

        return $this->result($results);
    }