Commit b40641e4 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[views] Display only on <button> for drop-down menus

I.e. instead of having two (clickable) buttons, one with the action text
(e.g. "add") and one with the caret and only the latter with the effect
of toggling the menu, we now only produce one button with both the
action text and the caret as content. This way, the user won't get
confused when clicking on the text as the menu will toggle.
parent 241e87a8ba9e
...@@ -170,9 +170,8 @@ def dropdown_button(text, links): ...@@ -170,9 +170,8 @@ def dropdown_button(text, links):
data = UStringIO() data = UStringIO()
w = data.write w = data.write
w(u'<div class="btn-group pull-right clearfix">') w(u'<div class="btn-group pull-right clearfix">')
w(tags.button(text, klass='btn btn-success'))
w(tags.button( w(tags.button(
tags.span(klass='caret'), u' '.join([text, tags.span(klass='caret')]),
escapecontent=False, escapecontent=False,
klass='btn btn-success dropdown-toggle', klass='btn btn-success dropdown-toggle',
**{'data-toggle': 'dropdown', 'aria-expanded': 'false'})) **{'data-toggle': 'dropdown', 'aria-expanded': 'false'}))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment