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
!54
Callback checks for changed dialog height every .5 seconds and repositions if necessary.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Callback checks for changed dialog height every .5 seconds and repositions if necessary.
issue/layout_paragraphs-3252978:3252978-large-modal-exceeds
into
2.0.x
Overview
1
Commits
5
Pipelines
0
Changes
3
Merged
Justin Toupin
requested to merge
issue/layout_paragraphs-3252978:3252978-large-modal-exceeds
into
2.0.x
3 years ago
Overview
1
Commits
5
Pipelines
0
Changes
3
Expand
Closes
#3252978
0
0
Merge request reports
Compare
2.0.x
version 2
38b8c319
3 years ago
version 1
6101af63
3 years ago
2.0.x (base)
and
latest version
latest version
0db9568a
5 commits,
3 years ago
version 2
38b8c319
9 commits,
3 years ago
version 1
6101af63
1 commit,
3 years ago
3 files
+
96
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
js/builder.es6.js
+
34
−
0
Options
@@ -21,6 +21,28 @@
Drupal
.
behaviors
.
AJAX
.
attach
(
$container
[
0
],
drupalSettings
);
}
/**
* Repositions open dialogs when their height changes.
*
* 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
* it impossible to reach parts of the content (for example, submit buttons).
* Repositioning the dialog fixes the issue.
* @see https://www.drupal.org/project/layout_paragraphs/issues/3252978
* @see https://stackoverflow.com/questions/5456298/refresh-jquery-ui-dialog-position
*
* @param {jQuery} $dialog
* The dialog jQuery object.
*/
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
);
}
}
/**
* Makes an ajax request to reorder all items in the layout.
* This function is debounced below and not called directly.
@@ -493,4 +515,16 @@
}
}
});
// Repositions open dialogs.
// @see https://www.drupal.org/project/layout_paragraphs/issues/3252978
// @see https://stackoverflow.com/questions/5456298/refresh-jquery-ui-dialog-position
$
(
window
).
on
(
'
dialog:aftercreate
'
,
(
event
,
dialog
,
$dialog
)
=>
{
if
(
$dialog
[
0
].
id
.
indexOf
(
'
lpb-dialog-
'
)
===
0
)
{
$dialog
.
data
(
'
lpOriginalHeight
'
,
$dialog
.
outerHeight
());
$dialog
.
data
(
'
lpDialogInterval
'
,
setInterval
(
repositionDialog
.
bind
(
null
,
$dialog
),
500
));
}
});
$
(
window
).
on
(
'
dialog:beforeclose
'
,
(
event
,
dialog
,
$dialog
)
=>
{
clearInterval
(
$dialog
.
data
(
'
lpDialogInterval
'
));
});
})(
jQuery
,
Drupal
,
Drupal
.
debounce
,
dragula
);
Loading