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

Widgets don't specify parent plugin as AMD dependency #855

Open
seemikehack opened this issue Mar 25, 2015 · 2 comments
Open

Widgets don't specify parent plugin as AMD dependency #855

seemikehack opened this issue Mar 25, 2015 · 2 comments

Comments

@seemikehack
Copy link

The A of AMD reveals that occasionally widgets will try to load before the tablesorter plugin and error out. The widgets should specify the parent as a dependency, or should get built into the parent file.

@Mottie
Copy link
Owner

Mottie commented Mar 26, 2015

Hi @seemikehack!

I think I found a solution... could you modify the UMD portion of your jquery.tablesorter.widget.js file and see if this works?

(function(factory) {
  if (typeof define === 'function' && define.amd) {
    define(['jquery', './jquery.tablesorter'], factory);
  } else if (typeof module === 'object' && typeof module.exports === 'object') {
    module.exports = factory(require('jquery'));
  } else {
    factory(jQuery);
  }
}(function($) {

Mottie added a commit that referenced this issue Mar 30, 2015
NOTE: the core js/jquery.tablesorter.js file is no longer UMD wrapped!; this is done by the build process now

Updated various parser & widget comments
@Mottie
Copy link
Owner

Mottie commented Mar 30, 2015

In this last update, the build now creates a jquery.tablesorter.combined.js file which includes the core plugin, and all selected widgets & parsers.

It's a work-around, and doesn't actually solve this issue.

@Mottie Mottie mentioned this issue Mar 10, 2016
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants