diff options
| author | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-24 11:43:53 +0300 |
|---|---|---|
| committer | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-10-24 18:36:18 +0300 |
| commit | bbb73d6e5cb6375f71793b00d8ef242268da897f (patch) | |
| tree | 316bd2b969b01dff1d95611197f74b42a7a5da0b /phpBB/styles/prosilver/template | |
| parent | 31345800078791e74c8935936c8e7edafb2a2797 (diff) | |
| download | forums-bbb73d6e5cb6375f71793b00d8ef242268da897f.tar forums-bbb73d6e5cb6375f71793b00d8ef242268da897f.tar.gz forums-bbb73d6e5cb6375f71793b00d8ef242268da897f.tar.bz2 forums-bbb73d6e5cb6375f71793b00d8ef242268da897f.tar.xz forums-bbb73d6e5cb6375f71793b00d8ef242268da897f.zip | |
[ticket/11956] Move dropdown menu from edges of screen
Also add -webkit prefix to box-sizing
PHPBB3-11956
Diffstat (limited to 'phpBB/styles/prosilver/template')
| -rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 0da3c77d53..23dfae9fab 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -451,6 +451,31 @@ function toggle_dropdown() options.dropdown.toggle(); 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'); + } + }); + } } /** |
