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 nv = $(this).val();
var tid = $(this).data('from');
$('#'+tid).html(htmlize(nv))
$('#'+tid).html(htmlize(nv));
initQuill();
};
$("#Content").change(onchange);
$("#Title").change(onchange);
@ -68,6 +69,8 @@
$(".mdcoding").addClass('hidden');
}
});
var initQuill = function() {
var editortitre = new Quill('#titleview', {
modules: { toolbar: '#Titletoolbar' },
theme: 'snow'
@ -81,31 +84,27 @@
$('#contentbar').addClass('hidden');
$('#Titletoolbar').removeClass('hidden');
}
});
editortitre.on('text-change',function(delta,source){
});
editortitre.on('text-change',function(delta,source){
if (source=='user')
{
updateMD('Title',$('#titleview').html())
}
});
});
editorcontenu.on('selection-change', function(range) {
if (range) {
$('#contentbar').removeClass('hidden');
$('#Titletoolbar').addClass('hidden');
}
});
editorcontenu.on('text-change',function(delta,source){
});
editorcontenu.on('text-change',function(delta,source){
if (source=='user')
{
updateMD('Content',$('#contentview').html())
}
});
$('#contentview').focus(function(){
$('#contentbar').removeClass('hidden');
$('#Titletoolbar').addClass('hidden');
})
});
};
initQuill();
Dropzone.options.postfiles= {
maxFilesize: 2, // MB

Loading…