You are here

public function DrupalViews::alterEditorJS in Advanced Insert View 8

Same name and namespace in other branches
  1. 2.0.x modules/bueditor/src/Plugin/BUEditorPlugin/DrupalViews.php \Drupal\insert_view_adv_bueditor\Plugin\BUEditorPlugin\DrupalViews::alterEditorJS()

File

modules/bueditor/src/Plugin/BUEditorPlugin/DrupalViews.php, line 33

Class

DrupalViews
Defines BUEditor Embedded Views plugin.

Namespace

Drupal\insert_view_adv_bueditor\Plugin\BUEditorPlugin

Code

public function alterEditorJS(array &$js, BUEditorEditor $bueditor_editor, Editor $editor = NULL) {
  $toolbar = BUEditorToolbarWrapper::set($js['settings']['toolbar']);

  // Check drupal views button.
  if ($toolbar
    ->has('drupalviews')) {
    $js['libraries'][] = 'insert_view_adv_bueditor/drupalviews';
  }
}