Skip to content
Snippets Groups Projects
Commit a24c0f46 authored by Ruud Simons's avatar Ruud Simons
Browse files

Enable gitlab-ci pipelines, fixes for #3450370 and #3360121.

parent 558420a4
Branches 8.x-1.x
Tags 8.x-1.4
No related merge requests found
Pipeline #184263 passed
......@@ -29,10 +29,20 @@ function block_button_modal_form_block_form_alter(&$form, FormStateInterface $fo
* Implements hook_ENTITY_TYPE_view_alter().
*/
function block_button_modal_block_view_alter(array &$build, $entity, $display) {
if (!$build['#block'] instanceof ThirdPartySettingsInterface) {
return;
if (isset($build['#block'])) {
if (!$build['#block'] instanceof ThirdPartySettingsInterface) {
return;
}
if (!$build['#block']->getThirdPartySetting('block_button_modal', 'enabled')) {
return;
}
}
elseif (isset($build['#configuration']['third_party_settings']['block_button_modal'])) {
if (!$build['#configuration']['third_party_settings']['block_button_modal']['enabled']) {
return;
}
}
if (!$build['#block']->getThirdPartySetting('block_button_modal', 'enabled')) {
else {
return;
}
......
(function (Drupal) {
Drupal.behaviors.block_button_modal_block = {
attach: function (context, settings) {
var wrappers = [];
if (context.classList && context.classList.contains('block-button-modal-block-wrapper')) {
attach(context, settings) {
let wrappers = [];
if (
context.classList &&
context.classList.contains('block-button-modal-block-wrapper')
) {
wrappers.push(context);
}
else {
wrappers = context.querySelectorAll('.block-button-modal-block-wrapper');
} else {
wrappers = context.querySelectorAll(
'.block-button-modal-block-wrapper',
);
}
wrappers.forEach(function (wrapper) {
var button = wrapper.querySelectorAll('button, input[type="submit"]'),
block = wrapper.querySelector('.block');
const button = wrapper.querySelectorAll('button, input[type="submit"]');
const block = wrapper.querySelector('.block');
if (!button[0] || !block) {
return;
}
button[0].dialog = Drupal.dialog('#' + block.getAttribute('id'), {
button[0].dialog = Drupal.dialog(`#${block.getAttribute('id')}`, {
title: button[0].getAttribute('data-block-button-modal-title'),
width: '100%',
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment