Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
d9337939
Commit
d9337939
authored
9 years ago
by
Guillaume Delhumeau
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-13337: Dropdown menus don't open in some conditions.
parent
270f619f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js
+14
-11
14 additions, 11 deletions
...go-skin-resources/src/main/resources/flamingo/flamingo.js
with
14 additions
and
11 deletions
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources/src/main/resources/flamingo/flamingo.js
+
14
−
11
View file @
d9337939
...
...
@@ -3,19 +3,22 @@ require(['jquery', 'bootstrap'], function($) {
// Fix the bad location of the dropdown menu when the trigger is close to the end of the screen.
// See: http://jira.xwiki.org/browse/XWIKI-12609
$
(
document
).
on
(
'
shown.bs.dropdown
'
,
function
(
event
,
data
)
{
var
toggle
=
$
(
data
.
relatedTarget
);
$
(
document
).
on
(
'
shown.bs.dropdown
'
,
function
(
event
)
{
var
toggle
=
$
(
event
.
relatedTarget
);
var
menu
=
toggle
.
next
(
'
.dropdown-menu
'
);
var
menuWidth
=
menu
.
outerWidth
();
// if the right corner of the menu is after the end of the screen
if
(
menu
.
offset
().
left
+
menuWidth
>
$
(
document
.
body
).
outerWidth
())
{
// we put that corner at the same place than the toggle's right corner
var
newLocation
=
toggle
.
offset
().
left
+
toggle
.
outerWidth
()
-
menuWidth
;
// but don't put it negative, or the user will have to scroll to the left!
if
(
newLocation
<
0
)
{
newLocation
=
0
;
// The menu might be not found if it is not located where it is expected.
if
(
menu
.
length
>
0
)
{
var
menuWidth
=
menu
.
outerWidth
();
// if the right corner of the menu is after the end of the screen
if
(
menu
.
offset
().
left
+
menuWidth
>
$
(
document
.
body
).
outerWidth
())
{
// we put that corner at the same place than the toggle's right corner
var
newLocation
=
toggle
.
offset
().
left
+
toggle
.
outerWidth
()
-
menuWidth
;
// but don't put it negative, or the user will have to scroll to the left!
if
(
newLocation
<
0
)
{
newLocation
=
0
;
}
menu
.
offset
({
'
left
'
:
newLocation
});
}
menu
.
offset
({
'
left
'
:
newLocation
});
}
});
...
...
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