Merge pull request #137 from natejlong/master
Fix ckeditor-init.js by giving it access to a valid jQuery instance, along with other minor changes to ckeditor-init.js
This commit is contained in:
commit
5ebc347a54
|
@ -1,20 +1,23 @@
|
||||||
$(function() {
|
;(function() {
|
||||||
|
var $ = $ || django.jQuery;
|
||||||
|
$(function() {
|
||||||
initialiseCKEditor();
|
initialiseCKEditor();
|
||||||
initialiseCKEditorInInlinedForms();
|
initialiseCKEditorInInlinedForms();
|
||||||
|
|
||||||
function initialiseCKEditorInInlinedForms() {
|
function initialiseCKEditorInInlinedForms() {
|
||||||
$(".add-row a, .grp-add-handler").click(function () {
|
$(document).on("click", ".add-row a, .grp-add-handler", function () {
|
||||||
initialiseCKEditor();
|
initialiseCKEditor();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
function initialiseCKEditor() {
|
function initialiseCKEditor() {
|
||||||
$('textarea[data-type=ckeditortype]').each(function(){
|
$('textarea[data-type=ckeditortype]').each(function(){
|
||||||
if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){
|
if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){
|
||||||
$(this).data('processed',"1");
|
$(this).data('processed',"1");
|
||||||
CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
|
CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
});
|
||||||
|
}());
|
||||||
|
|
Loading…
Reference in New Issue