class ajaxCommentsScrollToElementCommand in AJAX Comments 8
AJAX command for calling the ajaxCommentsScrollToElement() method.
Hierarchy
- class \Drupal\ajax_comments\Ajax\ajaxCommentsScrollToElementCommand implements CommandInterface
Expanded class hierarchy of ajaxCommentsScrollToElementCommand
File
- src/
Ajax/ ajaxCommentsScrollToElementCommand.php, line 17 - Contains \Drupal\ajax_comments\Ajax\ajaxCommentsScrollToElementCommand.
Namespace
Drupal\ajax_comments\AjaxView source
class ajaxCommentsScrollToElementCommand implements CommandInterface {
/**
* The CSS selector for the element.
*
* @var string
*/
protected $selector;
/**
* Constructs a ajaxCommentsScrollToElementCommand object.
*
* @param string $selector
*
*/
public function __construct($selector) {
$this->selector = $selector;
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'ajaxCommentsScrollToElement',
'selector' => $this->selector,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ajaxCommentsScrollToElementCommand:: |
protected | property | The CSS selector for the element. | |
ajaxCommentsScrollToElementCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
ajaxCommentsScrollToElementCommand:: |
public | function | Constructs a ajaxCommentsScrollToElementCommand object. |