This project is archived and is in readonly mode.

#340 ✓resolved
Dimitar Christoff

Tips creation injects element into dom too early when showDelay is enabled and fails to occlude instances

Reported by Dimitar Christoff | August 18th, 2010 @ 07:15 PM

http://mootools.net/shell/vQJ9x/8/ shows the problem

when using showDelay option and the tip itself does not exist (i.e. first viewing), it goes through toElement which injects this.tip into the DOM.

I believe it should only create the element and leave it outside of the DOM until the first this.show, which would take into account showDelay etc.

the effect spills into other possible usages, for example, if you want onShow/onHide functionality that uses tip.fade("in") / tip.fade("out"), the first mouseover NEVER fades.

I have applied a simple fix via a a this.notInDom = true; in the toElement method before it returns this.tip and have removed the injection into the DOM.

Within elementEnter and the this.timer callback, I check for this.notInDom and inject it, then set to false.

Not sure if this is the most elegant solution you can do but it works. http://fragged.org/dev/Tips.php or the updated shell http://mootools.net/shell/vQJ9x/9/

gist http://gist.github.com/537449

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket

Tags

Referenced by

Pages