Nice! thanks Arron!

This is the line that I was missing:

"myTips.elementEnter(event, link);  //shows the tip "

Even if that was not intended at the time this was authored, still
might be cool to put the undoc-ed method in the docs because anyone
trying to tip a Google map with markers added asynchronously is going
to have to do this for Tips (and I would think that is a fairly common
mashup element these days!)

Thanks again!

On Jan 5, 2:23 pm, nutron <[email protected]> wrote:
> The problem you're running up against is that tips really isn't designed for
> this (which is not to say that it shouldn't be, but that your use case was
> not included in the scope of the plugin when it was authored.
> There's an easy enough fix for this though:
>
> var myTips = new Tips();
>
> link.addEvent("mouseenter", function(event) {
>    myTips.attach(link);
>    myTips.elementEnter(event, link); //shows the tip
>
> });
>
> On Mon, Jan 5, 2009 at 2:14 PM, csuwldcat-2 (via Nabble) <
> [email protected]<ml-user%[email protected]>
>
>
>
> > wrote:
>
> > Hey Arron,
>
> > Gee maybe I am being unclear...I don't want to create a new function
> > to do attachment, I want to piggy back functionality on the current
> > one to show the tip right after attach regardless of what the mouse or
> > user is doing...
>
> > I get what you are saying, I think.  I am not really trying to call
> > the attach with another function to just attach, i just want to be
> > able to add tooltips when the person mouses over the tip elements.
> > Think of it this way.
>
> > I have a Google map, each marker has a title on it (inconsequentially
> > this is the marker.aa[0] node of the gmarker object).
> > Since this map i have dynamically adds new markers to it, adding all
> > markers on domready will not do the task because more come throughout
> > the user's time on the page.  So that leads me to assigning a delegate
> > to the map where in a mouseover of the marker image nodes does an
> > myTips.attach(marker.aa.[0]);
>
> > So that works fine and dandy, the problem is that the mouseover
> > attaches the tip (I assume pushing the new node into the object or
> > array) but the event to show that tip only fires on mouseover and
> > mouseover has occured before the tip was attached.  This means you
> > swing the mouse around for a second time and bam there it is in all
> > its tippy glory.
>
> > Michal hit the nail on the head, how do i show a tip that just was
> > attached without the event that usually triggers it, because you are
> > already over the element at that point ya know?
>
> > Michal's solution uses an undocumented event, that is fine, I was
> > thinking of trying something similar next...but...I still have to
> > think that this would be easier on anyone doing something like this:
>
> > markerTips = new Tips($$('.marker_tip'), {
> >    className: 'cc_tip',
> >    showDelay: 0,
> >    hideDelay: 0,
> >    onAttach: function(tip){
> >       tip.theFunctionInTheLibThatMakesThemAppearOnMouseoverNatively();
> >    }
> > });
>
> > Am I just Captian Retardo on this or taking crazy pills? :)
>
> > On Jan 5, 12:34 pm, Michal 
> > <michalchare...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=0>>
> > wrote:
> > > I event thought of a 3rd way, that calls the 'elementEnter' method
> > > from within an extended attach method:
> >http://yetagain.net/sandbox/tipstestnoeventextended/
> > > .
>
> > > This way, at least the call to an undocumented function remains within
> > > the extended Tips class (so if that function ever changes in the
> > > future, it should be easily found).
>
> > > Michal.
>
> > > On Jan 5, 8:21 pm, Michal 
> > > <michalchare...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=1>>
> > wrote:
>
> > > > Oops that second link ishttp://yetagain.net/sandbox/tipstestnoevent/
>
> > > > On Jan 5, 8:20 pm, Michal 
> > > > <michalchare...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=2>>
> > wrote:
>
> > > > > I created a test athttp://yetagain.net/sandbox/tipstest/, with a
> > > > > modified version of my extended class that fires the 'attach' event.
> > > > > It does use the undocumented 'elementEnter' method however. The is
> > > > > called in a listener to the custom 'attach' event.
>
> > > > > Also, reading what Nutron wrote, that perhaps a custom event is not
> > > > > necessary, I made another (simpler) test
> > athttp://localhost:8888/yetagain/sandbox/tipstestnoevent/thatdoesnot
> > > > > extend the Tips class with a custom event (although it still uses the
>
> > > > > undocumented 'elementEnter' method to show the tip).
>
> > > > > Not completely sure if this is what you're after though...
>
> > > > > Michal.
>
> > > > > On Jan 5, 7:57 pm, nutron 
> > > > > <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=3>>
> > wrote:
>
> > > > > > To clarify, you're saying that you are creating an instance of tips
> > only
> > > > > > when the user actually mouses over something, yes?
> > > > > > The reason there's no event fired on attach is because this
> > functionality
> > > > > > occurs either on initialize (if you specify elements) or when you
> > attach
> > > > > > elements yourself. Therefor the event is something you essentially
> > already
> > > > > > have access to - you know it's going to fire when you call "new
> > Tips" or
> > > > > > when you call "myTips.attach(elements)".
>
> > > > > > Events are used when things occur arbitrarily - the user clicks,
> > the ajax
> > > > > > returns, the effect ends. There's no reason to add an event here.
>
> > > > > > On Mon, Jan 5, 2009 at 11:21 AM, csuwldcat-2 (via Nabble) <
> > > > > > ml-user+164628-370837...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=4>
> > <ml-user%2b164628-370837...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=5>>
>
> > > > > > > wrote:
>
> > > > > > > Hmm... not sure that that would solve the issue.  I can attach
> > the
> > > > > > > tips fine on mouseover.  Attaching is not the problem.  When the
> > > > > > > attachment takes place I need it to fire whatever event Moo uses
> > to
> > > > > > > show the tip.  Not sure onShow would be it, I think it piggy
> > backs
> > > > > > > something else.
>
> > > > > > > You see what I mean?  Just try attaching a tip to anything with a
>
> > > > > > > title on mouseover.  You will quickly see what I mean.
>
> > > > > > > - Daniel
>
> > > > > > > On Jan 5, 9:11 am, Michal <michalchare...@...<
> >http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2114397&i=0>>
> > > > > > > wrote:
> > > > > > > > Actually I suspect you might need to pass an argument with the
> > event,
> > > > > > > > so something like:
>
> > > > > > > > this.fireEvent('attach', this);
>
> > > > > > > > or
>
> > > > > > > > this.fireEvent('attach', this.tip);
>
> > > > > > > > might be required.
>
> > > > > > > > Michal.
>
> > > > > > > > On Jan 5, 4:54 pm, Michal <michalchare...@...<
> >http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2114397&i=1>>
> > > > > > > wrote:
>
> > > > > > > > > I suspect you could do something like extend the Tips class,
> > and have
> > > > > > > > > an extended attach method that fires the event:
>
> > > > > > > > > var ExtendedTips = new Class({
> > > > > > > > >   Extends: [Tips],
>
> > > > > > > > >   attach: function(elements) {
> > > > > > > > >     this.parent(elements);
> > > > > > > > >     this.fireEvent('attach');
> > > > > > > > >     return this;
> > > > > > > > >   }
>
> > > > > > > > > });
>
> > > > > > > > > However, I've never used Tips, so maybe someone has a better
> > > > > > > > > suggestion.
>
> > > > > > > > > Michal.
>
> > > > > > > > > On Jan 5, 3:47 pm, csuwldcat <daniel...@...<
> >http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2114397&i=2>>
> > > > > > > wrote:
>
> > > > > > > > > > Hey guys, wanted to do just-in-time attachment for Tips.  I
> > am doing
> > > > > > > > > > so for a Google maps markers where the addition of said
> > markers is
> > > > > > > > > > compounding and dynamic in nature.  Right now I .attach()
> > the tip on
> > > > > > > > > > mouseover of the target marker via event delegation.  The
> > problem is
> > > > > > > > > > that the tip does not appear until the second mouseover
> > obviously...
>
> > > > > > > > > > What would be ridiculously sick would be to have an
> > onAttach(); that
> > > > > > > I
> > > > > > > > > > could do a:
>
> > > > > > > > > > onAttach: function(tip){
> > > > > > > > > > tip.show();
>
> > > > > > > > > > }
>
> > > > > > > > > > That would rock most certainly rock the Casba.
>
> > > > > > > > > > PS: if there is a glaringly easy way to do this other than
> > fireEvent
> > > > > > > > > > (); (which I already tried to work in) please impress upon
> > me your
> > > > > > > > > > mootastic, sage-like wisdom :)
>
> > > > > > > > > > - Daniel
>
> > > > > > > ------------------------------
> > > > > > >  View message @
>
> >http://n2.nabble.com/Msg-for-Moo-Devs-on-Tooltips...Maybe-we-need-an-...
> > > > > > > To start a new topic under MooTools Users, email
> > > > > > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=6>
> > <ml-node%2b660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2115191&i=7>>
>
> > > > > > > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> > > > > > -----
> > > > > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > > > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > > > > --
> > > > > > View this message in context:
> >http://n2.nabble.com/Msg-for-Moo-Devs-on-Tooltips...Maybe-we-need-an-...
> > > > > > Sent from the MooTools Users mailing list archive at Nabble.com.
>
> > ------------------------------
> >  View message @
> >http://n2.nabble.com/Msg-for-Moo-Devs-on-Tooltips...Maybe-we-need-an-...
> > To start a new topic under MooTools Users, email
> > [email protected]<ml-node%[email protected]>
> > To unsubscribe from MooTools Users, click here< (link removed) >.
>
> -----
> The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> Clientcide:  http://www.clientcide.comwww.clientcide.com
> --
> View this message in 
> context:http://n2.nabble.com/Msg-for-Moo-Devs-on-Tooltips...Maybe-we-need-an-...
> Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to