kopia lustrzana https://github.com/wagtail/wagtail
Shorten code for retrieving button title
rodzic
c35c1f360a
commit
73e1961f96
|
@ -261,14 +261,10 @@ 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,
|
'title': self.attrs.get('title'),
|
||||||
'is_parent': self.is_parent})
|
'is_parent': self.is_parent})
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue