my17560 / dokuwiki-template-readthedokus

"Read the Docs" flavored DokuWiki template
MIT License
14 stars 11 forks source link

Clicking on an item on TOC expands the JS TreeNew sidebar #88

Closed eduardomozart closed 6 months ago

eduardomozart commented 7 months ago

When I expand the sidebar through the expander, it works as expected.

GravacaodeTela2024-04-30as10 57 27-ezgif com-video-to-gif-converter

But when clicking on subtopics of the page, it also expands the sidebar ("SNMP" subns is shown). I believe those kind of events on TOC should be intercepted and a "preventDefault" clause be added to avoid those kind of issues when clicking on TOC. I believe it happens as TOC is embedded on FancyTree (IndexMenu JS TreeNew) so it triggers the expand event when clicked. It didn't seem to happen before the fixes applied this weekend.

my17560 commented 6 months ago

Could you give me simple test pages so that I can confirm it on my computer?

my17560 commented 6 months ago

I modified it to call preventDefault() in the TOC click handler. Could you try?

eduardomozart commented 6 months ago

The problem seems to continue, as can be seen below: GravacaodeTela2024-05-03as08 51 16-ezgif com-video-to-gif-converter Here's the files to reproduce the issue: 3cx.zip

my17560 commented 6 months ago

Thanks, but I couldn't re-produce the situation.

image

When I click "4.Phones", the triangular icon on left of the TOC disappears.

image

Since I'm not familiar with IndexMenu, I don't know how to make it work.

eduardomozart commented 6 months ago
  1. Create a :sidebar (https://wiki.example.com/doku.php?id=sidebar) page with the following content:
** Ferramentas do Wiki **

  * [[this>doku.php?id=start|Página principal]]
  * [[this>doku.php?id=wiki:plugin:addnewpage:newpage|Criar página]]

** Barra de Navegação **

{{indexmenu>..:#1|js#awesome navbar nsort nogroup treenew}}
  1. Go to :3cx:phones namespace (https://wiki.example.com/doku.php?id=3cx:phones).
  2. Click on "+ Add Phone" subitem.
  3. You'll notice the "4. Phone Provisioning" (https://wiki.example.com/doku.php?id=3cx:phones:add) will be expanded on sidebar, but it should only expand when clicking on the expand arrow (>) of FancyTree instead of when clicking on an item on TOC.
my17560 commented 6 months ago

Hi, I tried but no luck.

I went to :3cx:phones, but "4. Phone Provisioning" didn't appear even though I clicked "+Add Phone".

image

Seems like IndexMenu is not fetching its children.

名称未設定

I'll learn the IndexMenu more so give me some more time.

my17560 commented 6 months ago

I found out how to fetch children. I added max options in IndexMenu options.

{{indexmenu>..:#1|js#awesome navbar nsort nogroup treenew max#2}}

image

I confirmed your issue and I'll work on it.

my17560 commented 6 months ago

I fixed and committed. Could you try?

eduardomozart commented 6 months ago

Hello, thank you! It seems to be working as expected now!