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

Can't repeatedly create and destroy tooltip #15387

Closed
ghost opened this issue Dec 17, 2014 · 8 comments
Closed

Can't repeatedly create and destroy tooltip #15387

ghost opened this issue Dec 17, 2014 · 8 comments

Comments

@ghost
Copy link

ghost commented Dec 17, 2014

                               var destroy = $(this).data("ui-validate.error-destory");
                if(!destroy){
                    destroy = function(){
                        $(this).tooltip('destroy');
                    }
                    $(this).data("ui-validate.error-destory",destroy);
                }

                $(this).tooltip('destroy')
                .tooltip({title:message,placement:'bottom'})
                .tooltip('show')
                .focus()
                .off("blur",destroy)
                .on("blur",destroy);
@juthilo juthilo added the js label Dec 17, 2014
@cvrebert
Copy link
Collaborator

You have typos: "destory" [sic] instead of "destroy"

Please post a full JS Fiddle or JS Bin version of your example that doesn't use AngularJS.

@ghost
Copy link
Author

ghost commented Dec 18, 2014

The jsfiddle link:
http://jsfiddle.net/pittlu/qytpofm9/5/

@cvrebert
Copy link
Collaborator

The docs are admittedly not clear about this, but show and hide are async. They return before the actual showing/hiding completes.
After fixing your example to account for this, the tooltip message does get changed: http://jsfiddle.net/8pb8u023/1/

@cvrebert cvrebert added the docs label Dec 18, 2014
@ghost
Copy link
Author

ghost commented Dec 18, 2014

Why the message blinks when you click more than once.
The event shown.bs.tooltip doesn't trigger by the second click.

@ghost
Copy link
Author

ghost commented Dec 18, 2014

There seems a BUG with destroy method of tooltip,A success code with hack like this: http://jsfiddle.net/pittlu/8pb8u023/2/

@cvrebert
Copy link
Collaborator

Perhaps you are encountering #15168.

@ghost
Copy link
Author

ghost commented Dec 18, 2014

I hope the next version can fix this issue.

@cvrebert
Copy link
Collaborator

cvrebert commented Jan 6, 2015

Closing in favor of #15168 & #15500.

@cvrebert cvrebert closed this as completed Jan 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants