Fix "toggle batch complete" for Chrome browser

This commit is contained in:
Lance Edgar 2023-01-13 16:49:16 -06:00
parent cac005f993
commit 83f9a3faa7
3 changed files with 26 additions and 17 deletions

View file

@ -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'