Comments (4)
Yep this should be fixed. What's the expected behaviour when there has been no tipsification? Return null? Throw a catchable error? My gut reaction is the latter but that doesn't seem very idiomatic JS. Keen to hear your thoughts.
-J
from tipsy.
I'd much prefer a null
return to an exception.
Having said that, it wasn't until I peeked at the source code that I realized that the tipsy()
function doesn't simply return this
, like a typical jQuery function (or rather, it doesn't when an option string is given). What's the reason for this? The examples in the docs never use the return value.
If there isn't a reason, then I think the ideal behavior would be for $obj.tipsy('hide')
to always return $obj
. That's what jQuery users expect, right? For instance, $obj.hide()
will always return $obj
even if $obj
is already hidden.
from tipsy.
This was a deliberate decision, the reasoning was that since the option string form of tipsy()
is basically a dumb proxy to the Tipsy object, that it would be unwise to assume (either now or in the future) the proxied method's return value to be insignificant.
However I can see the argument for chainability. If one needs the return value I guess there's nothing to stop them doing var tipsy = $foo.tipsy(true), retVal = tipsy.blahBlah();
.
So, agreed, I'll change it to return the jQuery object.
from tipsy.
tipsy object proxy method tolerates null object and now returns this
. closed by 23994f5
from tipsy.
Related Issues (20)
- mouseover buggy in lte-ie8
- tooltip at disabled elements? HOT 1
- Option Gravity
- [enhancement] Add missing bower.json.
- autoBounds doesn't take tipsy's own size into account!
- Pull requests are not merged or closed HOT 1
- Browser support? HOT 1
- Don't work with submit button HOT 3
- Commit 23994f5 broke B/C that $obj.tipsy('tip') doesn't return $tip anymore
- Not working on first page load HOT 1
- add main option in bower file
- Tooltip width decreases on multiple hovers. HOT 6
- The variable pos has an undefined width in Internet Explorer because offsetWidth is not cross-browser.
- Add bower link to the package
- Tipsy forcing "Update layer Tree"
- Chrome deprecating SVG offsetWidth and offsetHeight
- Mouseover with Ctrl, Alt and Shift keys?
- Jquery tipsy not working with jQuery 3.2.1 HOT 2
- http://onehackoranother.com/projects/jquery/tipsy/ This page isnβt working
- Remove hover event only for touch devices
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tipsy.