0
0
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:
Liam Brenner 2016-04-04 13:51:20 +10:00 committed by Matt Westcott
parent d5bbc8d687
commit da3d3c8585
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div {{ self.attrs }} class="c-dropdown {% if is_parent %}t-inverted{% else %}t-default{% endif %}" data-dropdown> <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 }} {{ label }}
<div data-dropdown-toggle class="o-icon c-dropdown__toggle [ icon icon-arrow-down ]"></div> <div data-dropdown-toggle class="o-icon c-dropdown__toggle [ icon icon-arrow-down ]"></div>
</a> </a>

View File

@ -83,7 +83,7 @@ def page_listing_buttons(page, page_perms, is_parent=False):
page=page, page=page,
page_perms=page_perms, page_perms=page_perms,
is_parent=is_parent, 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') @hooks.register('register_page_listing_more_buttons')

View File

@ -261,9 +261,14 @@ class BaseDropdownMenuButton(Button):
raise NotImplementedError raise NotImplementedError
def render(self): def render(self):
if 'title' in self.attrs:
title = self.attrs['title']
else:
title = None
return render_to_string(self.template_name, { return render_to_string(self.template_name, {
'buttons': self.get_buttons_in_dropdown(), 'buttons': self.get_buttons_in_dropdown(),
'label': self.label, 'label': self.label,
'title': title,
'is_parent': self.is_parent}) 'is_parent': self.is_parent})