foundation / foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
https://get.foundation
MIT License
29.66k stars 5.48k forks source link

Tooltips broken with "instance is not defined" in foundation.tooltip.js #4580

Closed tmugford closed 10 years ago

tmugford commented 10 years ago

PR #4567 appears to have broken tooltips. Specifically, line 34.

tmugford commented 10 years ago

I haven’t entirely got my head around how foundation.tooltips.js works, but it looks like the fix is as simple as replacing self.create(this.S(instance)); with self.create(S(this));. I'm happy to submit a PR if someone more familiar with this component can confirm my suspicions.

I should add, the aforementioned change appears to resolve the issue in my limited testing.

nikhilkalige commented 10 years ago

@tmugford I checked now.. i did not get the error.. I am using the following markup

<!DOCTYPE html>

<html class="no-js" lang="en">
<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>Foundation</title>
    <link href="stylesheets/app.css" rel="stylesheet">
    <script src="bower_components/modernizr/modernizr.js"></script>
</head>

<body style="background-color: #eee">
    <div class="row">
        <div class="large-6 columns">
            <span data-tooltip class="has-tip" title="Tooltips are awesome, you should totally use them!">extended information</span>
        </div>
        <div class="large-6 columns">

        </div>
    </div>
    <script src="bower_components/jquery/jquery.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.abide.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.accordion.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.clearing.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.alert.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.dropdown.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.equalizer.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.interchange.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.joyride.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.magellan.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.offcanvas.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.orbit.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.reveal.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.tab.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.tooltip.js"></script>
    <script src="bower_components/foundation/js/foundation/foundation.topbar.js"></script>
    <script src="js/app.js"></script>
</body>
</html>
tmugford commented 10 years ago

Hey @NikhilKalige,

Thanks for getting back to me so quickly. I've just cloned a new instance of the repository, installed NPM and bower dependencies and generated the documentation, and I'm still seeing the error when viewing dist/docs/components/tooltips.html in both Chrome 33 and Safari 7.

nikhilkalige commented 10 years ago

@tmugford Thank you for pointing that out... Missed it during the push :)

tmugford commented 10 years ago

@NikhilKalige No problem. Thanks for the quick fix.