Skip to content

Commit

Permalink
fix(forms): add script to load jQuery globally
Browse files Browse the repository at this point in the history
Adds jQuery to global vars (window.jQuery) if it was removed by
Grappelli, since other packages expect it to be there.

Related to modlinltd#49
  • Loading branch information
asfaltboy committed Aug 22, 2017
1 parent fd88fef commit 5045963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions advanced_filters/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class Meta:
class Media:
required_js = [static('admin/js/%sjquery.min.js' %
('vendor/jquery/' if USE_VENDOR_DIR else '')),
static('advanced-filters/jquery_adder.js'),
static('orig_inlines%s.js' %
('' if settings.DEBUG else '.min')),
static('magnific-popup/jquery.magnific-popup.js'),
Expand Down
3 changes: 3 additions & 0 deletions advanced_filters/static/advanced-filters/jquery_adder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(function($) {
if (!window.jQuery) window.jQuery = $;
})(window._jq || jQuery || grp.jQuery);

0 comments on commit 5045963

Please sign in to comment.