Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New + button added #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GJRobert
Copy link

This button can open the namespace when the headpage is present. The headpage link to the page, and the + button opens the namespace. Feel free to improve the code since I'm really a novice.

This button can open the namespace when the headpage is present. The headpage link to the page, and the + button opens the namespace.
@Klap-in
Copy link
Collaborator

Klap-in commented Oct 31, 2017

Could you add here a screenshot of this feature? I wondering if I understand your addition. Thanks!

@GJRobert
Copy link
Author

There you go!
indexmenu (nojs) with new "plus" button

First of all, this pull request deals with the "nojs" version of indexmenu. In the screenshot, most of the namespaces do not have headpages, so those links just open the folded child nodes inside. But notice those two headpages, titled "DokuWiki" and "孩子們" (for "kids" in Mandarin Chinese), indexmenu used to render them as simple page links, and no child nodes would be opened.

Now with the "+" buttons added in this commit (red-circled), those buttons toggles the namespaces open or closed, just like other namespace links.


But ACTUALLY I'm planning for another arrangement: instead of making the headpage link to the page, maybe it's better to make the behavior consistent: namespace links should always toggle open/close, and for headpage links, a text link showing "(page)" can be appended after the namespace link (which can be styled to be displayed as an icon?)

And also an idea of adding a config option to let admin decide the behavior is on my mind.

How would you suggest?

@GJRobert
Copy link
Author

GJRobert commented Nov 1, 2017

I have tried the alternative method mentioned above, and opened another branch with new commit on my fork: Alternative method proposed · GJRobert/indexmenu@215c0ac (further explanation and screenshot attached there)

I refrain from opening another pull request for that, because I think it's better to wait for your evaluation and suggestions :-)

I myself prefer the second method after a little reflection. But favor of the public may differ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants