jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Bugs => Topic started by: schmatzler on 16.09.2015 15:16:24

Title: Joomla 3.4.4: Fix for broken tooltips - [Solved - but not really a bug in jD]
Post by: schmatzler on 16.09.2015 15:16:24
I was scratching my head on this one for a while, maybe it helps others.

When I made the update from Joomla 3.4.3 to 3.4.4 the tooltips for the download description in the modules didn't show up anymore.

What happened?

By comparing the source of the website I found out, that bootstrap.min.js was missing - also, this snippet of code wasn't inserted anymore:
jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});

The tooltips worked fine when other components inserted the js by themselves (that's why it worked as a super-user since I had frontend menu editing activated).

How to fix?
The fix for this is pretty simple. In the template's index.php I added
JHTML::_('bootstrap.tooltip');
just before the <!DOCTYPE html> section.

However, this is a little bit crude, since it now loads the tooltip javascript on every page.
It's fine for me, but a better fix would be to insert this code into the various modules so it only loads when it's needed.
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: ColinM on 16.09.2015 17:16:44
Hi
Thanks
That is really helpful

Just to be clear we now need to insert bootstrap.min.js in each module and also include
jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});
Colin
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: schmatzler on 17.09.2015 00:36:02
Just adding

JHTML::_('bootstrap.tooltip');

should do all that automatically. ;)
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: Arno on 17.09.2015 01:28:43
JHtml::_('behavior.tooltip');
(mootools) is not longer supported?

So we need
JHTML::_('bootstrap.tooltip');additional or instead?
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: schmatzler on 17.09.2015 23:32:27
Mootools is still included, but will be deprecated soon, according to the wiki.

I never used Mootools. Apparently it can be included with
JHtml::_('behavior.framework');

but that doesn't do anything by itself, it just loads the mootools.js. No tooltips.

With
JHTML::_('bootstrap.tooltip');

the javascript files for bootstrap get included and also the section for enabling tooltips is put into the code:
jQuery('.hasTooltip').tooltip({"html": true,"container": "body"});

For me it looks like this is the way it should be. I'm not a coder, though.
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: Arno on 18.09.2015 00:09:07
Thanks. I will check it.
In the Joomla core seems to be used both.
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: schmatzler on 18.09.2015 10:45:42
The default themes include Mootools, JQuery and Bootstrap, yes.

But not every theme does it, like mine. ;) I also don't like the idea of just adding "everything" to the mix for a tooltip :P
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: Arno on 18.09.2015 11:15:00
Hm..  versuchs mal lieber mit deutsch. ;)
Wir brauchen ja eine Lösung die mit allen templates arbeitet. Und bis zu deinem Update auf 3.4.4 war das ja wohl auch kein Problem (bei dir).

Für uns Entwickler ist es nicht immer ganz einfach, wenn Joomla mal wieder hunderte Dinge nach einem Update geändert hat und wir uns wundern, wieso das eine oder andere plötzlich nicht mehr läuft. Das hat schon viele Entwickler vergrault, die Joomla den Rücken gekehrt haben.

Ich werde mich also mal wieder auf die Suche machen müssen, welche Vorgehensweise denn in diesem Punkt empfohlen wird.  :(
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: schmatzler on 18.09.2015 18:10:30
Das Theme was ich benutze, stammt noch aus der Joomla 2.5-Zeit.

Standardmaessig wurde da weder Bootstrap noch Mootools geladen - es wird nur das eingefuegt, was Joomla von sich aus laedt.

Die beiden Themes von Joomla 3.4 laden sowohl Mootools als auch die bootstrap.min.js. Find' ich bisschen komisch, aber wahrscheinlich machen sie das um rueckwaertskompatibel zu einigen Erweiterungen zu bleiben.

Da Bootstrap mittlerweile bei sehr vielen Themes genutzt wird um responsive designs zu machen, duerften die allerwenigsten Nutzer Probleme haben, da sowieso immer das richtige Zeug geladen wird.

Im Grunde kann man es auch so lassen - der Nutzer muss dann fuer sein Theme selbst sicherstellen, dass bootstrap geladen wird. Mootools alleine funktioniert jedenfalls nicht, oder ich bin zu bloed das hinzubekommen.
Title: Re: Joomla 3.4.4: Fix for broken tooltips
Post by: Arno on 19.09.2015 17:44:58
Danke. Ich hab es jetzt entsprechend abgeändert.
Title: Re: Joomla 3.4.4: Fix for broken tooltips - [Solved - but not really a bug in jD]
Post by: schmatzler on 20.09.2015 15:57:38
Thanks. Now it works as it did before  ;D