UX: Allow clicking anywhere on the topic-list card (#166)
This commit is contained in:
@@ -83,6 +83,34 @@ export default {
|
|||||||
api.registerValueTransformer("topic-list-item-mobile-layout", () => {
|
api.registerValueTransformer("topic-list-item-mobile-layout", () => {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
api.registerBehaviorTransformer(
|
||||||
|
"topic-list-item-click",
|
||||||
|
({ context: { event }, next }) => {
|
||||||
|
if (event.target.closest("a, button, input")) {
|
||||||
|
return next();
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const topicLink = event.target
|
||||||
|
.closest("tr")
|
||||||
|
.querySelector("a.raw-topic-link");
|
||||||
|
|
||||||
|
// Redespatch the click on the topic link, so that all key-handing is sorted
|
||||||
|
topicLink.dispatchEvent(
|
||||||
|
new MouseEvent("click", {
|
||||||
|
ctrlKey: event.ctrlKey,
|
||||||
|
metaKey: event.metaKey,
|
||||||
|
shiftKey: event.shiftKey,
|
||||||
|
button: event.button,
|
||||||
|
bubbles: true,
|
||||||
|
cancelable: true,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
grid-column-gap: 12px;
|
grid-column-gap: 12px;
|
||||||
grid-row-gap: 8px;
|
grid-row-gap: 8px;
|
||||||
border-radius: var(--d-border-radius);
|
border-radius: var(--d-border-radius);
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
td.main-link .link-top-line {
|
td.main-link .link-top-line {
|
||||||
grid-row: 1/2;
|
grid-row: 1/2;
|
||||||
|
|||||||
Reference in New Issue
Block a user