Skip to content

jquery plugin extensability#989

Closed
tuler wants to merge 1 commit intotwbs:2.0-wipfrom
tuler:jquery-plugin-extensability
Closed

jquery plugin extensability#989
tuler wants to merge 1 commit intotwbs:2.0-wipfrom
tuler:jquery-plugin-extensability

Conversation

@tuler
Copy link

@tuler tuler commented Jan 13, 2012

This enhances jquery plugin extensability, forwarding all parameters to the plugin method.

this enhances plugin extensability, forwarding all parameters to the
plugin method
@fat
Copy link
Member

fat commented Jan 14, 2012

bootstrap plugins are designed to only ever accept one argument. More than that should be passed via an object literal

@fat fat closed this Jan 14, 2012
@tuler
Copy link
Author

tuler commented Jan 15, 2012

What do you mean by "passed via an object literal"?

Just to clarify the issue, I wanted to implement a new method to the carousel, so I extended the plugin and added a "go" method, which should receive the destination as a parameter.
https://github.com/tuler/bootstrap/blob/carousel-go/js/bootstrap-carousel-ext.js

But the extra parameter wasn't being forwared by the plugin. How do I make this kind of extension via an object literal?

@fat fat reopened this Jan 15, 2012
@fat
Copy link
Member

fat commented Jan 15, 2012

Ahh i see - hm... let me think about it

@fat
Copy link
Member

fat commented Jan 22, 2012

The goto functionality is now supported by the carousel plugin.

To use it - just call carousel with a frame index like this:

$('#myCarousel').carousel(3)

I think i'm going to hold off on calling the constructor with arguments like this proposal for now unless another similar issue comes up. thanks!

@fat fat closed this Jan 22, 2012
@tuler
Copy link
Author

tuler commented Jan 23, 2012

Ok, pulled and tested. Thanks.

@agad
Copy link

agad commented Feb 5, 2012

Any possibility of re-opening this? I have just started working with Bootstrap and find that I've had to add a lot of functionality to several of the plugins, but none of this functionality is really something that anyone else would really want as it is specific to our apps. Its not a big deal to make the necessary change to the constructors, but I would think that others may want this functionality as well to avoid ever touching the plugins themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants