Check for jQuery presence correctly.

This commit is contained in:
Piotr Maliński 2014-12-07 21:03:50 +01:00
parent 1983840b76
commit 7b67aba231
1 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,12 @@
;(function() {
var $ = $ || django.jQuery;
(function() {
var djangoJQuery;
if (typeof jQuery == 'undefined' && typeof django == 'undefined') {
console.error('ERROR django-ckeditor missing jQuery. Set CKEDITOR_JQUERY_URL or provide jQuery in the template.');
} else if (typeof django != 'undefined') {
djangoJQuery = django.jQuery;
}
var $ = jQuery || djangoJQuery;
$(function() {
initialiseCKEditor();
initialiseCKEditorInInlinedForms();
@ -25,6 +32,6 @@
CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
}
});
};
}
});
}());