aboutsummaryrefslogtreecommitdiff
path: root/static/components/tab-group-element.ts
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-12 02:17:34 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-12 02:17:34 +0200
commit80cc46667de5062e097f5cd6e51e74c40e5bb063 (patch)
treec18453a6b82cec08627add3bc1a202d9532ef659 /static/components/tab-group-element.ts
parentMerge all datetime tests to one file. (diff)
downloadcalp-80cc46667de5062e097f5cd6e51e74c40e5bb063.tar.gz
calp-80cc46667de5062e097f5cd6e51e74c40e5bb063.tar.xz
Fix edit popups not auto opening.
Depending an the exact text of an translatable string seems like a bad idea.
Diffstat (limited to 'static/components/tab-group-element.ts')
-rw-r--r--static/components/tab-group-element.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/static/components/tab-group-element.ts b/static/components/tab-group-element.ts
index 05cac7d2..8a65964d 100644
--- a/static/components/tab-group-element.ts
+++ b/static/components/tab-group-element.ts
@@ -87,6 +87,11 @@ class TabGroupElement extends ComponentVEvent {
but still defaut to '?' if no text is found */
label = label || child.dataset.label || (child.textContent + '?')[0];
title = title || child.dataset.title || '';
+ let extra_attributes = {};
+ /* Used to target a tab by name */
+ if (child.dataset.originaltitle) {
+ extra_attributes = { 'data-originaltitle': child.dataset.originaltitle }
+ }
let tab_id = gensym('tab_content_');
let label_id = gensym('tab_label_');
@@ -100,6 +105,7 @@ class TabGroupElement extends ComponentVEvent {
title: title,
'aria-selected': false,
'aria-controls': tab_id,
+ ... extra_attributes,
})
let tabContainer = makeElement('article', {}, {