diff options
Diffstat (limited to 'phpBB/styles/prosilver/template/forum_fn.js')
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 1b2b1954ef..d4653c1be3 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.verticalDirection = 'left'; + if ($this.hasClass('dropdown-right')) options.verticalDirection = 'right'; + + phpbb.registerDropdown(trigger, contents, options); + }); + + /** * Adjust HTML code for IE8 and older versions */ if (oldBrowser) { |