brunjo / rowGrid.js

A small, lightweight JavaScript plugin for placing items in straight rows (jQuery and vanilla JS version) – Demo:
http://brunjo.github.io/rowGrid.js/
MIT License
670 stars 78 forks source link

Problems with selector assumptions #2

Closed rjackson closed 10 years ago

rjackson commented 10 years ago

Having a quick look at the project's code I believe it falsely assumes that it will only be called from a single valid selector, which causes problems when:

1) The selector doesn't match anything, which throws a Javascript error - and thus ceases the execution of all the other scripts on the page (a big problem!),

2) If somebody passes a selector matching multiple objects, e.g. they have a page with 3 rowGrid containers - each with the class "rowGrid" - would $('.rowGrid').rowGrid() only initialize the functionality to only apply on the first container?


The former problem I have encountered within a project of mine, though the latter is mere speculation - I haven't actually tested it.

brunjo commented 10 years ago

Thanks for your feedback! I will fix both bugs.

rjackson commented 10 years ago

Fantastic :)

Thanks a lot for the plugin too - I probably should've said that above, it's really great work :)