mouseover tooltip on toolbar button?

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Post Reply
User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

mouseover tooltip on toolbar button?

Post by carsten888 » Sat May 18, 2019 11:51 am

In a component admin page I would like to add a mouse-over tooltip to a toolbar button. Is there a Joomla-way for doing this?

Maybe I'm not looking in the right place, but there does not seem to be something like that in the options. Not even an alt text.
https://docs.joomla.org/Creating_a_tool ... _component

Would be nice to get a tooltip like those on the sort-coloms in list view, just to explain what the button does.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
paulala
Joomla! Explorer
Joomla! Explorer
Posts: 301
Joined: Sat Oct 30, 2010 12:32 pm
Location: Scotland
Contact:

Re: mouseover tooltip on toolbar button?

Post by paulala » Sat May 18, 2019 1:27 pm

Warm Regards,
Paula Livingstone, Skydiving Instructor and Network Security Consultant
https://paulalivingstone.com
http://rustyice.co.uk

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: mouseover tooltip on toolbar button?

Post by carsten888 » Sat May 18, 2019 2:44 pm

No.

The toolbar buttons are generated from code like this:

Code: Select all

JToolBarHelper::publish('userspages_publish', 'JTOOLBAR_PUBLISH', true);
		JToolBarHelper::unpublish('userspages_unpublish', 'JTOOLBAR_UNPUBLISH', true);
		JToolBarHelper::divider();			
		JToolBarHelper::custom('userspages_empty','delete.png','delete_f2.png',JText::_('COM_USERPRIVATEPAGE_EMPTY').' '.JText::_('COM_USERPRIVATEPAGE_PAGE'),false,false);	
		JToolBarHelper::custom('userspages_export', 'download', 'download', JText::_('JTOOLBAR_EXPORT').' .csv', false, false );
So I can't just add html, like an alt tag or a title to the html and javascript a tooltip with that. Of course I can javascript a custom tooltip for it, but I rather work with what already exists in the Joomla core.
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: mouseover tooltip on toolbar button?

Post by carsten888 » Mon Jun 17, 2019 2:45 pm

I now just added titles to sort-of simulate tooltips on the toolbar buttons.

in admin default.php

Code: Select all

document.onload = setTimeout( "set_tooltips()" , 200);

function set_tooltips(){	
	parent = document.getElementById('toolbar');		
	parent.children[3].title = 'Delete selected comments';
	parent.children[4].title = 'Reset the number of reminders to 0';
	parent.children[5].title = 'Mark as read by the user';
	parent.children[6].title = 'Mark as unread by the user';	
}

Far from perfect, but better then nothing.
I would rather have those nice tooltips from the admin pages column headers. ('select to sort by this column', which should actually be 'click to sort by this column'). O well. Maybe in Joomla 4 :geek:
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...

User avatar
carsten888
Joomla! Ace
Joomla! Ace
Posts: 1224
Joined: Sat Feb 11, 2006 8:32 am
Contact:

Re: mouseover tooltip on toolbar button?

Post by carsten888 » Wed Jun 19, 2019 7:01 am

result with the above code:
Image

(can't see the mouse-hand in the screenshot)
http://www.pages-and-items.com my extensions:
User-Private-Page, Redirect-on-Login, Admin-Help-Pages, Dynamic-Menu-Links, Admin-Menu-Manager, plugin load module in article, plugin pure css tooltip and more...


Post Reply

Return to “Joomla! 3.x Coding”