Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
layout_paragraphs
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
layout_paragraphs
Merge requests
!74
Resolve
#3252978
"Large modal exceeds"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Resolve
#3252978
"Large modal exceeds"
issue/layout_paragraphs-3252978:3252978-large-modal-exceeds
into
2.0.x
Overview
0
Commits
17
Pipelines
0
Changes
2
Closed
Justin Toupin
requested to merge
issue/layout_paragraphs-3252978:3252978-large-modal-exceeds
into
2.0.x
3 years ago
Overview
0
Commits
17
Pipelines
0
Changes
2
Expand
Closes
#3252978
0
0
Merge request reports
Compare
2.0.x
version 3
14990659
3 years ago
version 2
4371ac4c
3 years ago
version 1
a3560589
3 years ago
2.0.x (base)
and
latest version
latest version
a44b45e2
17 commits,
3 years ago
version 3
14990659
17 commits,
3 years ago
version 2
4371ac4c
19 commits,
3 years ago
version 1
a3560589
12 commits,
3 years ago
2 files
+
37
−
32
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
js/builder.es6.js
+
19
−
17
Options
@@ -22,7 +22,7 @@
}
/**
* Repositions open dialogs when their height changes.
* Repositions open dialogs when their height changes
to exceed viewport
.
*
* The height of an open dialog will change based on its contents and can
* cause a dialog to grow taller than the current window viewport, making
@@ -31,16 +31,24 @@
* @see https://www.drupal.org/project/layout_paragraphs/issues/3252978
* @see https://stackoverflow.com/questions/5456298/refresh-jquery-ui-dialog-position
*
* @param {
jQu
er
y
}
$dialog
* The
dialog jQuery object
.
* @param {
Numb
er}
intervalId
* The
interval id
.
*/
function
repositionDialog
(
$dialog
)
{
const
height
=
$dialog
.
outerHeight
();
if
(
$dialog
.
data
(
'
lpOriginalHeight
'
)
!==
height
)
{
const
pos
=
$dialog
.
dialog
(
'
option
'
,
'
position
'
);
$dialog
.
dialog
(
'
option
'
,
'
position
'
,
pos
);
$dialog
.
data
(
'
lpOriginalHeight
'
,
height
);
function
repositionDialog
(
intervalId
)
{
const
$dialogs
=
$
(
'
.lpb-dialog
'
);
if
(
$dialogs
.
length
===
0
)
{
clearInterval
(
intervalId
);
return
;
}
$dialogs
.
each
((
i
,
dialog
)
=>
{
const
bounding
=
dialog
.
getBoundingClientRect
();
const
viewPortHeight
=
window
.
innerHeight
||
document
.
documentElement
.
clientHeight
;
if
(
bounding
.
bottom
>
viewPortHeight
)
{
const
$dialog
=
$
(
'
.ui-dialog-content
'
,
dialog
);
const
pos
=
$dialog
.
dialog
(
'
option
'
,
'
position
'
);
$dialog
.
dialog
(
'
option
'
,
'
position
'
,
pos
);
}
});
}
/**
@@ -529,14 +537,8 @@
let
lpDialogInterval
;
$
(
window
).
on
(
'
dialog:aftercreate
'
,
(
event
,
dialog
,
$dialog
)
=>
{
if
(
$dialog
[
0
].
id
.
indexOf
(
'
lpb-dialog-
'
)
===
0
)
{
if
(
lpDialogInterval
)
{
clearInterval
(
lpDialogInterval
);
}
$dialog
.
data
(
'
lpOriginalHeight
'
,
$dialog
.
outerHeight
());
lpDialogInterval
=
setInterval
(
repositionDialog
.
bind
(
null
,
$dialog
),
500
);
clearInterval
(
lpDialogInterval
);
lpDialogInterval
=
setInterval
(
repositionDialog
.
bind
(
null
,
lpDialogInterval
),
500
);
}
});
$
(
window
).
on
(
'
dialog:beforeclose
'
,
()
=>
{
clearInterval
(
lpDialogInterval
);
});
})(
jQuery
,
Drupal
,
Drupal
.
debounce
,
dragula
);
Loading