Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
block_button_modal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
block_button_modal
Commits
a24c0f46
Commit
a24c0f46
authored
8 months ago
by
Ruud Simons
Browse files
Options
Downloads
Patches
Plain Diff
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
8 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
block_button_modal.module
+13
-3
13 additions, 3 deletions
block_button_modal.module
js/block_button_modal_block.js
+13
-10
13 additions, 10 deletions
js/block_button_modal_block.js
with
26 additions
and
13 deletions
block_button_modal.module
+
13
−
3
View file @
a24c0f46
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
js/block_button_modal_block.js
+
13
−
10
View file @
a24c0f46
(
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%
'
,
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment