diff options
-rw-r--r-- | phpBB/adm/style/admin.css | 3 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 33 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/common.css | 28 |
3 files changed, 59 insertions, 5 deletions
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index d971c38efb..c4f1caf722 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -2365,11 +2365,14 @@ fieldset.permissions .padding { .dropdown .dropdown-contents { z-index: 2; overflow: hidden; + overflow-y: auto; background: #fff; border: 1px solid #b9b9b9; border-radius: 5px; padding: 5px; position: relative; + min-width: 40px; + max-height: 200px; box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 1b2b1954ef..a45f750a63 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -434,6 +434,39 @@ function parse_document(container) }); /** + * Dropdowns + */ + container.find('.dropdown-container').each(function() { + var $this = $(this), + trigger = $this.find('.dropdown-trigger:first'), + contents = $this.find('.dropdown'), + options = { + direction: 'auto', + verticalDirection: 'auto' + }, + data; + + if (!trigger.length) { + data = $this.attr('data-dropdown-trigger'); + trigger = data ? $this.children(data) : $this.children('a:first'); + } + + if (!contents.length) { + data = $this.attr('data-dropdown-contents'); + contents = data ? $this.children(data) : $this.children('div:first'); + } + + if (!trigger.length || !contents.length) return; + + if ($this.hasClass('dropdown-up')) options.verticalDirection = 'up'; + if ($this.hasClass('dropdown-down')) options.verticalDirection = 'down'; + if ($this.hasClass('dropdown-left')) options.direction = 'left'; + if ($this.hasClass('dropdown-right')) options.direction = 'right'; + + phpbb.registerDropdown(trigger, contents, options); + }); + + /** * Adjust HTML code for IE8 and older versions */ if (oldBrowser) { diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index dced25f541..3cc3ce1afe 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -407,6 +407,14 @@ li.responsive-menu .dropdown .dropdown-contents { padding: 0 5px; } +ul.linklist .dropdown-down .dropdown { + top: 22px; +} + +ul.linklist .dropdown-up .dropdown { + bottom: 18px; +} + ul.linklist .dropdown li { clear: both; } @@ -437,10 +445,18 @@ ul.linklist.bulletin li.no-bulletin:before { /* Dropdown menu ----------------------------------------*/ +.dropdown-container { + position: relative; +} + +.nojs .dropdown-container:hover .dropdown { + display: block !important; +} + .dropdown { position: absolute; left: 0; - top: 22px; + top: 1.2em; z-index: 2; border: 1px solid transparent; border-radius: 5px; @@ -449,16 +465,15 @@ ul.linklist.bulletin li.no-bulletin:before { .dropdown-up .dropdown { top: auto; - bottom: 18px; + bottom: 1.2em; padding: 0 0 9px; } -.dropdown-left .dropdown { +.dropdown-left .dropdown, .nojs .rightside .dropdown { left: auto; right: 0; } - .dropdown .pointer, .dropdown .pointer-inner { position: absolute; width: 0; @@ -488,7 +503,7 @@ ul.linklist.bulletin li.no-bulletin:before { top: auto; } -.dropdown-left .dropdown .pointer { +.dropdown-left .dropdown .pointer, .nojs .rightside .dropdown .pointer { left: auto; right: 10px; } @@ -507,10 +522,13 @@ ul.linklist.bulletin li.no-bulletin:before { .dropdown .dropdown-contents { z-index: 2; overflow: hidden; + overflow-y: auto; border: 1px solid transparent; border-radius: 5px; padding: 5px; position: relative; + min-width: 40px; + max-height: 200px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; |