This project is archived and is in readonly mode.

#195 ✓resolved
Christopher Cilley

Error seen with Tips

Reported by Christopher Cilley | November 26th, 2009 @ 06:14 AM | in 1.2.4.3

I get an error in both FF (3.0.15) and IE7 on even a simple page with Tips in MooTools v1.2.4.2 if there is an enclosing div in the page. This example is right out of the docs for Tips:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" language="javascript" src="scripts/mootools.js"></script>
<script type="text/javascript" language="javascript">
window.addEvent('domready', function() {
var myTips = new Tips('.thisisatooltip');
});
</script>
</head>
<body>
<div>
<h2>Test my tool tips</h2>
<a href="http://mootools.net" title="mootools homepage" class="thisisatooltip" />Show Tip</a>
</div>
</body>
</html>

In Firebug I get the error:
element.getParent is not a function on line 6782 of mootools.js

6780 fireForParent: function(event, element){
6781 if (!element) return;
6782 parentNode = element.getParent();
6783 if (parentNode == document.body) return;
6784 if (parentNode.retrieve('tip:enter')) parentNode.fireEvent('mouseenter', event);
6785 else this.fireForParent(parentNode, event);
6786 },

If I simply remove the enclosing div, no error is thrown.

Comments and changes to this ticket

  • Daniele C.

    Daniele C. December 9th, 2009 @ 09:43 AM

    The problem seems to be in the last line of the fireForParent method:

    the line is:

    else this.fireForParent(parentNode, event);
    

    but the definition of the function is:

    fireForParent: function(event, element){
    

    Then, simply change the last line in:

    else this.fireForParent(event, parentNode);
    

    Solve the error problem

  • fakedarren

    fakedarren January 11th, 2010 @ 08:05 PM

    • Milestone set to backlog
    • State changed from “new” to “open”
    • Assigned user set to “fakedarren”

    This has already been resolved and will be included in the next release (Hopefully towards the end of this week).

  • Aaron Newton

    Aaron Newton January 14th, 2010 @ 06:25 PM

    • State changed from “open” to “resolved”
    • Milestone changed from backlog to 1.2.4.3

    fixed for 1.2.4.3 (soon)

Create your profile

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

The MooTools Extensions

Attachments

Tags

Pages