New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip is not rational uses memory #157

Closed
ankostyuk opened this Issue Sep 2, 2010 · 2 comments

Comments

Projects
None yet
2 participants
@ankostyuk

Each showing Tooltip are bind events:
tooltip.js

/**

  • @license
  • jQuery Tools 1.2.4 Tooltip - UI essentials
  • NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
  • http://flowplayer.org/tools/tooltip/
    *
  • Since: November 2008
  • Date: Sun Aug 15 08:16:31 2010 +0000
    */

(function($) {
// static constructs
$.tools = $.tools || {version: '1.2.4'};
//...
function Tooltip(trigger, conf) {

    $.extend(self, {

//...
show: function(e) {
//...
// tooltip events
var event = conf.events.tooltip.split(/,\s*/);

            tip.bind(event[0], function() { 
                clearTimeout(timer);
                clearTimeout(pretimer);
            });

            if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) {                    
                tip.bind(event[1], function(e) {

                    // being moved to the trigger element
                    if (e.relatedTarget != trigger[0]) {
                        trigger.trigger(evt[1].split(" ")[0]);
                    }
                }); 
            } 

            return self;
        },

//...
}
//...

}) (jQuery);

First showing:
tooltip.getTip().data("events")["mouseenter"].length is 1.

Tenth showing:
tooltip.getTip().data("events")["mouseenter"].length is 10.

N showing:
tooltip.getTip().data("events")["mouseenter"].length is N.

Need to unbind previously-attached events.

@ankostyuk

This comment has been minimized.

Show comment
Hide comment
@ankostyuk

ankostyuk Sep 12, 2010

OK, it works. Thanks. Glad to cooperate.

OK, it works. Thanks. Glad to cooperate.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment