germanysbestkeptsecret / Wookmark-jQuery

A jQuery plugin to create a dynamic, multi-column layout.
MIT License
2.64k stars 759 forks source link

Clean up non-jquery use-case #230

Open andrewjmead opened 7 years ago

andrewjmead commented 7 years ago

Hey Folks,

The docs mentioned that this plugin can be used without jQuery. That does seem to be the case, but I had to modified the final line of the plugin where jQuery is passed into the IIFE. That reference will cause the following error if jQuery is not defined:

wookmark.js:783 Uncaught ReferenceError: jQuery is not defined

I was able to fix this by swapping out the last line:

// Current line
})(jQuery);

// Tweaked line
})(typeof jQuery === 'undefined' ? undefined : jQuery);

This fixes the issue and everything else seems to be working great.

Would you be open to a PR that fixes this?

Sebobo commented 7 years ago

Sure a PR is always welcome! Wonder what changed that this now creates an error. This code worked for a long time.