gasparesganga/jquery-loading-overlay

Replace $ with jQuery

Closed this issue · 3 comments

Hi,

I've implemented your awsome plugin in a WordPress setup using the default WordPress functions. See below:

wp_enqueue_script( 'loadingoverlay', get_stylesheet_directory_uri() . '/js/site/loadingoverlay.min.js', array('jquery') );
wp_enqueue_script( 'loadingoverlay_progress', get_stylesheet_directory_uri() . '/js/site/loadingoverlay_progress.min.js', array('jquery', 'loadingoverlay') );

Doing so results in an error: typeError $ is undefined for the progress extra. Replacing all occurrences of $ with jQuery in the loading overlay_progress.min.js file fixes that issue. As far as I can tell the Progress plugin lacks a safe reference to jQuery.

The main plugin uses (function($, undefined) as a correct reference to jQuery. Shouldn't the Progress plugin shouldn't do so as well?

Hi. I apologise for this delayed answer but my working and personal schedule is pretty busy these days.
You are absolutely right, I'll fix this right away, thank your for your feedback!

v1.6.0 fixes this!
Next release will be a major one and we will get rid of this ugly extra concept in favour of a better and integrated solution.

Just implemented this release: works like a charm 😀. Thanks for the update.