tryexceptpass / sofi

an OS agnostic UI module for Python
MIT License
387 stars 49 forks source link

Add Bootstrap Tooltip #55

Open tryexceptpass opened 8 years ago

tryexceptpass commented 8 years ago

First there's the question of whether or not to directly generate the HTML required for a tooltip or to fallback on adding a command to the JavaScript lib that calls the .tooltip() function on a given selector.

If creating the HTML ourselves, then a Tooltip object is needed which well generate the necessary div elements to do so and bind the events properly. The last part is what makes me think its best to do it all directly in JS because it would save websocket bandwidth, as there is no need to query our python code on every mouse over simply to set something that we already know we're going to set.

If not creating the HTML, then we could implement a simple tooltip function that takes an existing object and sets the appropriate data-toggle="tooltip" data-placement and title attributes such that the tooltip is generated at the client side.

Must support click, hover, focus and manual triggers, as well as delay, animation, placement and viewport settings.