--- +++ @@ -5,3 +5,3 @@ import { - el, mount, card, button, field, fieldValue, modal, + sectionTabs, el, mount, card, button, field, fieldValue, modal, toast, confirmDialog, busy, loadingBlock, errorBlock, emptyBlock, @@ -55,3 +55,3 @@ { key: 'templates', label: 'inf_tab_templates', icon: '📄' }, - { key: 'connections', label: 'inf_tab_connections', icon: '🔗' }, + { key: 'connections', label: 'inf_tab_connections', icon: 'network' }, ]; @@ -64,10 +64,3 @@ const host = el('div', { class: 'page' }); - const tabbar = el('div', { class: 'subtabs' }); - TABS.forEach(function (tb) { - tabbar.appendChild(el('button', { - class: 'subtab' + (tb.key === active ? ' active' : ''), - onClick: function () { drawShell(view, tb.key); }, - }, [el('span', { text: tb.icon }), ' ', t(tb.label)])); - }); - const content = el('div', { class: 'subcontent' }, [loadingBlock()]); + const { tabbar, content } = sectionTabs(TABS, active, key => drawShell(view, key)); mount(host, [tabbar, content]); @@ -167,3 +160,3 @@ const names = (e.detail.existing || []).join('، '); - confirmDialog(t('inf_dup_q', { names: names })).then(function (ok) { if (ok) submit(ev, true); }); + confirmDialog(t('inf_dup_q', { names: names })).then(function (ok) { if (ok) submit({currentTarget:btn}, true); }); } else { toast(errText(e) || t('error_generic'), 'error'); }