iamceege/tooltipster — pull request #70 by evangun (2013-10-27 16:38:56+00:00)
Title: Added method to get the tooltip element + restructured fn.tooltipster()

This pull request is again cumulative with the previous ones... I hope you'll be ok with them.

This commit does two things. It adds an elementTooltip method and it restructures the .tooltipster() function.

Not much to say about the method, it's 4 lines of codes that return the raw HTML element of the tooltip. That will help people like me who want to build interactive tooltip. Basic use case : I want the interactive tooltip to be closed only by clicks outside of it, so I need the element to do my bindings.

About restructuring : it does almost exactly what it did before, but in a more structured manner. It's much commented and now you know exactly what's going on. If more static methods need to be implemented later, now there's a switch for them right there.

The only difference is that your latest modification with the `else` block breaks the code of people who chain method calls on empty sets of objects (when $(sel) does not match anything). I believe this is an undesired behavior and I changed it back to what it was.