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

jquery plugin initializer doesn't return promise object #51

Open
embeepea opened this issue Jan 16, 2013 · 0 comments
Open

jquery plugin initializer doesn't return promise object #51

embeepea opened this issue Jan 16, 2013 · 0 comments
Assignees

Comments

@embeepea
Copy link
Member

The Multigraph jQuery plugin is documented on http://multigraph.github.com/docs/js.html to say that it returns a promise object:

var promise = $(selector).multigraph({...});
promise.done(function() { ... });

However, it does not really seem to be returning a promise, because the above doesn't work. It is probably returning the jQuery object instead, since that's the standard behavior fo jQuery plugins. In order to use the promise, we have to do something like the following code from fcav:

https://github.com/nemac/ol-fcav/blob/0063efd176a0aacbd6ccf9174afa54b8df5620ca/fcav.js#L1230-L1239

Resolve this disparity by either:

* changing the plugin so that it really returns a promise, or
* deciding that the standard plugin behavior of returning the jQuery object is better, in
  which case the documentation mentioned above should be changed.
@ghost ghost assigned embeepea Jan 16, 2013
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

1 participant