content "Auto-TOC icon" should everytime showed expand in main window (body)

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
ThomasSch
Posts: 3
Joined: Tue Mar 15, 2022 4:25 pm

content "Auto-TOC icon" should everytime showed expand in main window (body)

Unread post by ThomasSch »

I want, that the content of "Auto-TOC icon" (image 1) is always expanded in the main window (body).

I could imagine, that it looks something like (automatic) "table of contents" of the topic file in wikipedia (image 2).


I hope I have been able to express myself in a way that is halfway comprehensible.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: content "Auto-TOC icon" should everytime showed expand in main window (body)

Unread post by Tim Green »

Hi Thomas,

I can understand your desire for this, but it would be counterproductive. It makes the page look untidy, gets in the way of reading and it will become annoying very quickly, like a blinking advertising banner. Your users won't be grateful. Also, it will still close as soon as they click anywhere outside the menu anyway.

If you absolutely must do this, edit the hmtopic.js file in the skin and locate these lines of code right at the end:

Code: Select all

$(window).on("hashchange", function() {
	if (parent.window && parent.window.hmnavpages) {
		$("div#idcontent").css("visibility","hidden");
	}
	setTimeout(function() {
		toggleJump();
		},300);
	});
});
Insert these lines directly before the closing }); line at the end:

Code: Select all

	setTimeout(function(){
		$("img#hmAtocLink").trigger("click");
		}, 100);
The result will then be:

Code: Select all

$(window).on("hashchange", function() {
	if (parent.window && parent.window.hmnavpages) {
		$("div#idcontent").css("visibility","hidden");
	}
	setTimeout(function() {
		toggleJump();
		},300);
	});

	setTimeout(function(){
		$("img#hmAtocLink").trigger("click");
		}, 100);

});
The menu will then open automatically when a topic with an Auto-TOC is opened. Note again, it will still close automatically when the user clicks on the page. Changing that would require a much more extensive redesign. This is a dynamic menu and it is not designed to be a permanent part of the page. It would be much better to just leave it as it is. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply