You are here

function lightning_media_library_info_alter in Lightning Media 8.4

Same name and namespace in other branches
  1. 8.3 lightning_media.module \lightning_media_library_info_alter()

Implements hook_library_info_alter().

File

./lightning_media.module, line 456
Core media asset support for Lightning.

Code

function lightning_media_library_info_alter(array &$libraries, $extension) {
  if ($extension === 'entity_browser') {

    // Clicking the "Remove" or "Edit" buttons in the media browser doesn't
    // trigger the event that makes Quick Edit display the "Save" button.
    // Loading the drupal.file library before entity browser attaches the
    // file button event handlers to the media browser buttons.
    // @see Drupal.behaviors.fileButtons
    $libraries['entity_reference']['dependencies'][] = 'file/drupal.file';
  }
}