You are here

public function ScrollToElementCommand::render in Paragraphs Features 2.x

Same name and namespace in other branches
  1. 8 src/Ajax/ScrollToElementCommand.php \Drupal\paragraphs_features\Ajax\ScrollToElementCommand::render()

Return an array to be run through json_encode and sent to the client.

Overrides CommandInterface::render

File

src/Ajax/ScrollToElementCommand.php, line 44

Class

ScrollToElementCommand
Provides an AJAX command for scrolling an element into the view.

Namespace

Drupal\paragraphs_features\Ajax

Code

public function render() {
  return [
    'command' => 'scrollToElement',
    'drupalElementSelector' => $this->elementSelector,
    'drupalParentSelector' => $this->parentSelector,
  ];
}