fixes switch

between MD code edition & Quill edition
main
Paul Schneider 9 years ago
parent 6dd06b123f
commit 5bcb88ee2c
1 changed files with 37 additions and 38 deletions

@ -52,7 +52,8 @@
var onchange = function(){ var onchange = function(){
var nv = $(this).val(); var nv = $(this).val();
var tid = $(this).data('from'); var tid = $(this).data('from');
$('#'+tid).html(htmlize(nv)) $('#'+tid).html(htmlize(nv));
initQuill();
}; };
$("#Content").change(onchange); $("#Content").change(onchange);
$("#Title").change(onchange); $("#Title").change(onchange);
@ -68,6 +69,8 @@
$(".mdcoding").addClass('hidden'); $(".mdcoding").addClass('hidden');
} }
}); });
var initQuill = function() {
var editortitre = new Quill('#titleview', { var editortitre = new Quill('#titleview', {
modules: { toolbar: '#Titletoolbar' }, modules: { toolbar: '#Titletoolbar' },
theme: 'snow' theme: 'snow'
@ -100,12 +103,8 @@ editorcontenu.on('text-change',function(delta,source){
updateMD('Content',$('#contentview').html()) updateMD('Content',$('#contentview').html())
} }
}); });
};
initQuill();
$('#contentview').focus(function(){
$('#contentbar').removeClass('hidden');
$('#Titletoolbar').addClass('hidden');
})
Dropzone.options.postfiles= { Dropzone.options.postfiles= {
maxFilesize: 2, // MB maxFilesize: 2, // MB

Loading…