mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-16 13:44:12 +02:00
Merge remote-tracking branch 'cyberalien/ticket/11979' into develop
* cyberalien/ticket/11979: [ticket/11979] Fix errors in dropdown [ticket/11979] Add ability to create dropdown menu to prosilver
This commit is contained in:
@@ -433,6 +433,39 @@ function parse_document(container)
|
||||
jumpto($(this));
|
||||
});
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user