Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Running init() after delegate() causes an error

I'm using a Pro version, and spent a lot of time fighting this problem before I realized what's happening.

Seems that calling Tipped.init() after any Tipped.delegate() was called, causes
ReferenceError: selector is not defined.

Full example below. If I uncomment the undelegate() call, things work.

    <script type="text/javascript" src="//"></script>
    <script type="text/javascript" src="//"></script>
    <script type="text/javascript" src="assets/tipped/js/tipped/tipped.js"></script>
    <link rel="stylesheet" type="text/css" href="assets/tipped/css/tipped/tipped.css"/>

    <script type="text/javascript">
            $(document).ready(function() {
                Tipped.delegate('.delegation-example', { skin: 'blue' });
//                Tipped.undelegate('.delegation-example');

                // Crashes if undelegate not called

<span class='delegation-example' title="Created with event delegation">Delegation 1</span>
<span class='delegation-example' title="Another one">Delegation 2</span>
<span class='delegation-example' title="">Delegation 3</span>
<span class='delegation-example'>Delegation 4</span>
Sign In or Register to comment.