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

Add jQuery plugin support #2

Open
desandro opened this issue Nov 20, 2016 · 0 comments
Open

Add jQuery plugin support #2

desandro opened this issue Nov 20, 2016 · 0 comments

Comments

@desandro
Copy link
Member

Add at πŸ‘ reaction to this issue if you want Huebee to add jQuery plugin support. Do not add a "+1" comment β€” they will be deleted. Subscribe using the button in the sidebar for updates on this feature request.


I understand some users might be scared off by vanilla JS syntax new Huebee(), and are more comfortable with jQuery syntax .huebee(). Huebee jQuery plugin support would look like:

// initialize
var $colorInput = $('.color-input').huebee({
  // options
});

// methods
$colorInput.huebee( 'setColor', '#C25' );
$colorInput.huebee('open');
$colorInput.huebee('close');

// events
$colorInput.on( 'change.huebee', function( event, color, hue, sat, lum ) {
  console.log( 'color changed to: ' + color );
});

I've decided against jQuery support as I'd like to keep Huebee's source code small and simple. I don't feel jQuery support adds that much value over vanilla JS. jQuery plugin methods (i.e. .huebee( 'setColor', '#C25' ) do more to obfuscate actual JavaScript than to help understand it.

But, jQuery is widely popular and Huebee's user base is likely more comfortable with it, than vanilla JS.

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

No branches or pull requests

1 participant