mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
Added title to menu dropdown button
This commit is contained in:
parent
d5bbc8d687
commit
da3d3c8585
@ -1,5 +1,5 @@
|
||||
<div {{ self.attrs }} class="c-dropdown {% if is_parent %}t-inverted{% else %}t-default{% endif %}" data-dropdown>
|
||||
<a href="#" class="c-dropdown__button u-btn-current">
|
||||
<a href="#" title="{{ title }}" class="c-dropdown__button u-btn-current">
|
||||
{{ label }}
|
||||
<div data-dropdown-toggle class="o-icon c-dropdown__toggle [ icon icon-arrow-down ]"></div>
|
||||
</a>
|
||||
|
@ -83,7 +83,7 @@ def page_listing_buttons(page, page_perms, is_parent=False):
|
||||
page=page,
|
||||
page_perms=page_perms,
|
||||
is_parent=is_parent,
|
||||
attrs={'target': '_blank'}, priority=50)
|
||||
attrs={'target': '_blank', 'title': 'View more options'}, priority=50)
|
||||
|
||||
|
||||
@hooks.register('register_page_listing_more_buttons')
|
||||
|
@ -261,9 +261,14 @@ class BaseDropdownMenuButton(Button):
|
||||
raise NotImplementedError
|
||||
|
||||
def render(self):
|
||||
if 'title' in self.attrs:
|
||||
title = self.attrs['title']
|
||||
else:
|
||||
title = None
|
||||
return render_to_string(self.template_name, {
|
||||
'buttons': self.get_buttons_in_dropdown(),
|
||||
'label': self.label,
|
||||
'title': title,
|
||||
'is_parent': self.is_parent})
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user