Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bootstrap4_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
bootstrap4_modal
Commits
34a1b681
Commit
34a1b681
authored
11 months ago
by
iberdinsky
Browse files
Options
Downloads
Patches
Plain Diff
Update events triggers -
#3457776
parent
a0e4ea33
No related branches found
No related tags found
1 merge request
!13
Update events triggers - #3457776
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bootstrap4_modal.libraries.yml
+1
-0
1 addition, 0 deletions
bootstrap4_modal.libraries.yml
js/bs4_modal.dialog.js
+10
-4
10 additions, 4 deletions
js/bs4_modal.dialog.js
with
11 additions
and
4 deletions
bootstrap4_modal.libraries.yml
+
1
−
0
View file @
34a1b681
...
...
@@ -6,6 +6,7 @@ bs4_modal.dialog:
-
core/jquery
-
core/drupal
-
core/drupalSettings
-
core/drupal.dialog
-
core/drupal.debounce
-
core/drupal.displace
...
...
This diff is collapsed.
Click to expand it.
js/bs4_modal.dialog.js
+
10
−
4
View file @
34a1b681
...
...
@@ -22,6 +22,7 @@
Drupal
.
bs4_modal
=
function
(
element
,
options
)
{
var
undef
=
void
0
;
var
$element
=
$
(
element
);
const
domElement
=
$element
.
get
(
0
);
var
dialog
=
{
open
:
false
,
returnValue
:
undef
...
...
@@ -40,7 +41,9 @@
settings
.
backdrop
=
Boolean
(
settings
.
backdrop
);
}
$
(
window
).
trigger
(
'
dialog:beforecreate
'
,
[
dialog
,
$element
,
settings
]);
const
event
=
new
DrupalDialogEvent
(
'
beforecreate
'
,
dialog
,
settings
);
domElement
.
dispatchEvent
(
event
);
if
(
settings
.
dialogClasses
!==
undefined
)
{
$
(
'
.modal-dialog
'
,
$element
).
removeAttr
(
'
class
'
).
addClass
(
'
modal-dialog
'
).
addClass
(
settings
.
dialogClasses
);
...
...
@@ -79,7 +82,10 @@
$element
.
modal
(
'
show
'
);
}
// dialog.open = true;
$
(
window
).
trigger
(
'
dialog:aftercreate
'
,
[
dialog
,
$element
,
settings
]);
domElement
.
dispatchEvent
(
new
DrupalDialogEvent
(
'
aftercreate
'
,
dialog
,
settings
),
);
}
function
updateButtons
(
buttons
)
{
...
...
@@ -145,11 +151,11 @@
}
$element
.
on
(
'
hide.bs.modal
'
,
function
(
e
)
{
$
(
window
).
trigger
(
'
dialog:
beforeclose
'
,
[
dialog
,
$element
]
);
domElement
.
dispatchEvent
(
new
DrupalDialogEvent
(
'
beforeclose
'
,
dialog
)
);
});
$element
.
on
(
'
hidden.bs.modal
'
,
function
(
e
)
{
$
(
window
).
trigger
(
'
dialog:
afterclose
'
,
[
dialog
,
$element
]
);
domElement
.
dispatchEvent
(
new
DrupalDialogEvent
(
'
afterclose
'
,
dialog
)
);
});
return
dialog
;
...
...
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