Fix "toggle batch complete" for Chrome browser
This commit is contained in:
parent
cac005f993
commit
83f9a3faa7
3 changed files with 26 additions and 17 deletions
|
@ -2660,31 +2660,35 @@ class MasterView(View):
|
|||
normal.append(button)
|
||||
return normal
|
||||
|
||||
def make_buefy_button(self, label, is_primary=False,
|
||||
url=None, is_external=False,
|
||||
def make_buefy_button(self, label,
|
||||
type=None, is_primary=False,
|
||||
url=None, target=None, is_external=False,
|
||||
icon_left=None,
|
||||
**kwargs):
|
||||
"""
|
||||
Make and return a HTML ``<b-button>`` literal.
|
||||
"""
|
||||
btn_kw = dict(c=label, icon_pack='fas')
|
||||
btn_kw = kwargs
|
||||
btn_kw.setdefault('c', label)
|
||||
btn_kw.setdefault('icon_pack', 'fas')
|
||||
|
||||
if 'type' in kwargs:
|
||||
btn_kw['type'] = kwargs['type']
|
||||
if type:
|
||||
btn_kw['type'] = type
|
||||
elif is_primary:
|
||||
btn_kw['type'] = 'is-primary'
|
||||
|
||||
if url:
|
||||
btn_kw['href'] = url
|
||||
|
||||
if 'icon_left' in kwargs:
|
||||
btn_kw['icon_left'] = kwargs['icon_left']
|
||||
if icon_left:
|
||||
btn_kw['icon_left'] = icon_left
|
||||
elif is_external:
|
||||
btn_kw['icon_left'] = 'external-link-alt'
|
||||
else:
|
||||
btn_kw['icon_left'] = 'eye'
|
||||
|
||||
if 'target' in kwargs:
|
||||
btn_kw['target'] = kwargs['target']
|
||||
if target:
|
||||
btn_kw['target'] = target
|
||||
elif is_external:
|
||||
btn_kw['target'] = '_blank'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue