Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Add npm/browserify/webpack support without requiring globals etc. #810

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

maxkfranz
Copy link

@maxkfranz maxkfranz commented Nov 21, 2016

This adds support to qTip2 for use with npm+browserify or npm+webpack. With this change, you can now do this:

let registerQtip = require('qtip2');
let jQuery = require('jquery');

registerQtip( jQuery );

// now i can do jQuery('#foo').qtip(...)

This gives the dev control over when registration happens and it removes the need for globals.

Previously, you'd have to do this:

window.$ = window.jQuery = require('jquery');
require('qtip2');

This also makes it better when using qTip2 with tools like Cytoscape.js:

let cytoscape = require('cytoscape');
let registerQtip = require('qtip2');
let jquery = require('jquery');
let registerCyQtip = require('cytoscape-qtip');

registerQtip( jquery );
registerCyQtip( cytoscape, jquery );

References:

If you have any questions or any concerns, please let me know.

Thanks

…ependencies, because qtip does not `require()` them. They are plugin/extension dependencies.
…to be used. Just `require(‘qtip’)( jQuery )` to register qtip on the specified jQuery object.
@Kurtas
Copy link

Kurtas commented Jan 31, 2017

Do you plan merge?

@ajoslin103
Copy link

can we get a merge on this?

@ssmereka
Copy link

ssmereka commented May 8, 2017

Can we please get a merge on this?

1 similar comment
@tomasomaso
Copy link

Can we please get a merge on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants