class RefreshResponsive in Bootstrap Styles 1.0.x
AJAX command for invoking an arbitrary jQuery method.
The 'invoke' command will instruct the client to invoke the given jQuery method with the supplied data on the elements matched by the given selector. Intended for simple jQuery commands, such as attr(), addClass(), removeClass(), toggleClass(), etc.
Hierarchy
- class \Drupal\bootstrap_styles\Ajax\RefreshResponsive implements CommandInterface
Expanded class hierarchy of RefreshResponsive
File
- src/
Ajax/ RefreshResponsive.php, line 15
Namespace
Drupal\bootstrap_styles\AjaxView source
class RefreshResponsive implements CommandInterface {
/**
* A CSS selector string.
*
* If the command is a response to a request from an #ajax form element then
* this value can be NULL.
*
* @var string
*/
protected $selector;
/**
* A jQuery method to invoke.
*
* @var string
*/
protected $method;
/**
* An optional list of data to pass to the method.
*
* @var array
*/
protected $data;
/**
* Constructs an RefreshResponsive object.
*
* @param string $selector
* A jQuery selector.
* @param string $method
* The name of a jQuery method to invoke.
* @param array $data
* An optional array of data to pass to the method.
*/
public function __construct($selector, $method, array $data = []) {
$this->selector = $selector;
$this->method = $method;
$this->data = $data;
}
/**
* Implements Drupal\Core\Ajax\CommandInterface:render().
*/
public function render() {
return [
'command' => 'bs_refresh_responsive',
'selector' => $this->selector,
'method' => NULL,
'data' => $this->data,
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RefreshResponsive:: |
protected | property | An optional list of data to pass to the method. | |
RefreshResponsive:: |
protected | property | A jQuery method to invoke. | |
RefreshResponsive:: |
protected | property | A CSS selector string. | |
RefreshResponsive:: |
public | function |
Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface:: |
|
RefreshResponsive:: |
public | function | Constructs an RefreshResponsive object. |