Skip to content
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
Closed

Tooltip is not rational uses memory #157

ankostyuk opened this issue Sep 2, 2010 · 2 comments

Comments

@ankostyuk
Copy link

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.

@tipiirai
Copy link
Contributor

@ankostyuk
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants