Topic Entrance has a lot of space. How can I fix?

Hi everyone, how can I fix that ? please teach me

Hi,

What do you mean? It’s by design aligned to the right.
What are you trying to achieve?

1 Like

Hi @Arkshine

When I click on the topic, the Topic Entry Window always opens. It has a very wide area towards the left, I want to narrow it down.

You mean this?
image

And you would prefer to open it only when clicking on the number.

image

Am I correct?

Yes that’s true
It looks the same on in your screenshots. Even when you click on the space, that window opens.
I just want that window to open when I click on the number.

Can you try this snippet?

<script type="text/discourse-plugin" version="0.8">
    api.modifyClass("component:latest-topic-list-item",  {
        pluginId: "showEntrance",
        
        showEntrance(event) {
            if (event.target.classList.contains('posts-map')) {
                return this.unhandledRowClick(event, this.topic);
            }

            return this._super(...arguments);
        }
    })
</script>

EDIT: The code can be actually simplified.

3 Likes

It works! Thank you very much. :heart:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.