ManifestWebDesign / angular-gridster

An implementation of gridster-like widgets for Angular JS
http://manifestwebdesign.github.io/angular-gridster/
MIT License
964 stars 394 forks source link

Documentation should be clear about which dependencies are necessary #81

Open mtraynham opened 10 years ago

mtraynham commented 10 years ago

Trying to minimize the number of dependencies in use, so to be clear:

Base dependecies: bower_components/jquery/dist/jquery.js bower_components/javascript-detect-element-resize/jquery.resize.js (is this necessary?) bower_components/angular-gridster/src/angular-gridster.js bower_components/angular-gridster/src/angular-gridster.less

Using draggable or resizable (these seem to be dependencies for either): bower_components/jquery-ui/ui/jquery.ui.core.js bower_components/jquery-ui/ui/jquery.ui.widget.js bower_components/jquery-ui/ui/jquery.ui.mouse.js

Using draggable: bower_components/jquery-ui/ui/jquery.ui.draggable.js

Using resizable: bower_components/jquery-ui/ui/jquery.ui.resizable.js bower_components/jquery-ui/themes/base/jquery.ui.core.css bower_components/jquery-ui/themes/base/jquery.ui.resizable.css

There is no need for this file, since jquery is included: bower_components/javascript-detect-element-resize/detect-element-resize.js

This is all non-minified versions. Is this a correct assumption?

Edit: I guess suffice to say, if you want drag/resize of grid items, add jquery-ui. But jquery and that jquery.resize script are necessary.

danomatic commented 10 years ago

Agreed. Are you sure the detect-element-resize.js isn't needed? Browsers generally only support window resize events without this.

mtraynham commented 10 years ago

https://github.com/sdecima/javascript-detect-element-resize#libraries It seems to say that the library can be used without jquery, by only adding the detect-element-resize.js script. If you have jquery, they suggest to use jquery.resize.js.

Also the gridster script looks like it invokes using the jquery version. https://github.com/ManifestWebDesign/angular-gridster/blob/master/src/angular-gridster.js#L584

My confusion came from the demo. You guys have the other script included. https://github.com/ManifestWebDesign/angular-gridster/blob/master/index.html#L19

Also, I don't think ES5 shim is required anymore, but you also have that in the demo. https://github.com/ManifestWebDesign/angular-gridster/blob/master/index.html#L16

mtraynham commented 10 years ago

Also, it might be good to just move all the demo stuff to the gh-pages branch to avoid confusion with the library itself.

danomatic commented 10 years ago

My understanding is that that jQuery resize event only fires if that plugin has been loaded. Otherwise the only resize event comes from the window. I think that adding support for the event via detect-element-resize.js is enough for jQuery to pick it up. I'm not sure why we aren't just using the jQuery plugin...

Yeah, I'm not sure why ES5 shim is there. Someone needs to test on old IE and see if it still works. This directive should generally be more old IE compatible than the original gridster jQuery plugin.

If you are able to address any of these in the near future, I would be happy to merge your pull request. I'm totally underwater this week!