You are here

private static function FocalPointImageWidget::createFocalPointIndicator in Focal Point 8

Create the focal point form element.

Parameters

int $delta: The delta of the image field widget.

array $element_selectors: The element selectors to ultimately be used by javascript.

Return value

array The focal point field form element.

1 call to FocalPointImageWidget::createFocalPointIndicator()
FocalPointImageWidget::process in src/Plugin/Field/FieldWidget/FocalPointImageWidget.php
Processes an image_focal_point field Widget.

File

src/Plugin/Field/FieldWidget/FocalPointImageWidget.php, line 296

Class

FocalPointImageWidget
Plugin implementation of the 'image_focal_point' widget.

Namespace

Drupal\focal_point\Plugin\Field\FieldWidget

Code

private static function createFocalPointIndicator($delta, array $element_selectors) {
  $indicator = [
    '#type' => 'html_tag',
    '#tag' => 'div',
    '#attributes' => [
      'class' => [
        'focal-point-indicator',
      ],
      'data-selector' => $element_selectors['focal_point'],
      'data-delta' => $delta,
    ],
  ];
  return $indicator;
}