mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
[ticket/11956] Move dropdown menu from edges of screen
Also add -webkit prefix to box-sizing PHPBB3-11956
This commit is contained in:
parent
3134580007
commit
bbb73d6e5c
3 changed files with 30 additions and 0 deletions
|
@ -451,6 +451,31 @@ function toggle_dropdown()
|
||||||
|
|
||||||
options.dropdown.toggle();
|
options.dropdown.toggle();
|
||||||
parent.toggleClass(options.visibleClass, !visible).toggleClass('dropdown-visible', !visible);
|
parent.toggleClass(options.visibleClass, !visible).toggleClass('dropdown-visible', !visible);
|
||||||
|
|
||||||
|
// Check dimensions when showing dropdown
|
||||||
|
// !visible because variable shows state of dropdown before it was toggled
|
||||||
|
if (!visible) {
|
||||||
|
options.dropdown.find('.dropdown-contents').each(function() {
|
||||||
|
var $this = $(this),
|
||||||
|
windowWidth = $(window).width();
|
||||||
|
|
||||||
|
$this.css({
|
||||||
|
marginLeft: 0,
|
||||||
|
left: 0,
|
||||||
|
maxWidth: (windowWidth - 4) + 'px'
|
||||||
|
});
|
||||||
|
|
||||||
|
var offset = $this.offset().left,
|
||||||
|
width = $this.outerWidth(true);
|
||||||
|
|
||||||
|
if (offset < 2) {
|
||||||
|
$this.css('left', (2 - offset) + 'px');
|
||||||
|
}
|
||||||
|
else if ((offset + width + 2) > windowWidth) {
|
||||||
|
$this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -510,6 +510,10 @@ ul.linklist.bulletin li.no-bulletin:before {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
position: relative;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown li {
|
.dropdown li {
|
||||||
|
|
|
@ -516,6 +516,7 @@ blockquote .codebox {
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
border: 1px dashed transparent;
|
border: 1px dashed transparent;
|
||||||
clear: left;
|
clear: left;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue