I'm trying to move from 0.2.x to 0.3.0, however the module exporting code is not compatible with Browserify (or probably any CommonJS system).
The jQueryUI drag and drop plugin never correctly initializes.
This is because it is calling
try { GridStackUI = require('gridstack'); } catch(e) {}
Which always returns an empty object, because the gridstack.js file never actually exports anything, but instead "exports" to the global window scope, as seen in gridstack.js line 20:
And gridstack.js line 1729:
scope.GridStackUI = GridStack;
exports is never actually used, so calling require('gridstack') will then always return an empty object.
So I think the module loading code for both gridstack.js and gridstack.jQueryUI.js should be altered to export using the module.exports CommonJS pattern.
I think a good way to do this is looking at how backbonejs does this.
I'm trying to move from 0.2.x to 0.3.0, however the module exporting code is not compatible with Browserify (or probably any CommonJS system).
The jQueryUI drag and drop plugin never correctly initializes.
This is because it is calling
Which always returns an empty object, because the
gridstack.jsfile never actually exports anything, but instead "exports" to the globalwindowscope, as seen ingridstack.jsline 20:And
gridstack.jsline 1729:exportsis never actually used, so callingrequire('gridstack')will then always return an empty object.So I think the module loading code for both
gridstack.jsandgridstack.jQueryUI.jsshould be altered to export using themodule.exportsCommonJS pattern.I think a good way to do this is looking at how backbonejs does this.