MooTools tooltip objects not in global scope

37 views
Skip to first unread message

Chris Bradbury

unread,
Apr 5, 2016, 3:22:53 AM4/5/16
to Joomla! CMS Development
I'm building a component that involves duplicating media fields and I'm wanting the MooTools tooltips to work properly after duplication.

The method to attach the tooltips to the document [libraries/cms/html/behavior.php, line 305] doesn't seem to allow the tooltip objects to be accessed globally, so amending them later is far more complicated than it could be.

I made a quick, dirty edit to the attachment method, and replaced line 316 with:

   
var foo =  $('$selector').selector;
    foo
= foo.replace(/\./, '');
   
this[foo] = new Tips($('$selector').get(), $options);


This allows each tooltip object to be available globally, and they can be easily modified using MooTools' Tips attach() and detach() methods.

There's undoubtedly a neater way of coding it, but is there any reason why the tooltips objects aren't available globally? Or are they, and I'm just being dumb?
Reply all
Reply to author
Forward
0 new messages