?
avatar Yves-K
Yves-K
8 May 2017

Steps to reproduce the issue

Use JQuery UI tooltip (for instance in article or menu admin)
Yes, It is possible to use JQTooltip in the same DOM as a BSTooltip using the bridge functionality from JQ !
jQuery.widget.bridge('jqTooltip', jQuery.ui.tooltip);

But media/media/js/mediafield.js on line 139 attempts to destroy all existing tooltips (BS ones).
And this happens before one can set a bridge. So we get the error :

Uncaught Error: cannot call methods on tooltip prior to initialization; attempted to call method 'destroy'

Expected result

This conflict should not create an error

Actual result

This conflict creates an error and locks JavaScript !

System information (as much as possible)

Joomla! 3.7...

Additional comments

Before invoking the destroy method code should ensure the object is a tooltip
or, at least use a try and catch the error in order to let the page scripts go on
For instance

try{
     this.$input.tooltip('destroy');
} catch(err){
     // do we have to do something with this error ?
}
avatar Yves-K Yves-K - open - 8 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 May 2017
Category JavaScript
avatar PhilETaylor
PhilETaylor - comment - 10 May 2017

Please test PR #15951

avatar Bakual Bakual - change - 10 May 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-05-10 20:34:52
Closed_By Bakual
avatar Bakual Bakual - close - 10 May 2017
avatar Bakual
Bakual - comment - 10 May 2017

Closing as we have a PR

Add a Comment

Login with GitHub to post a comment