$(window).on('mousemove', function (e) {
let x = e.pageX;
let w = $(this).innerWidth()
- let ratio= Math.min(33.33, x / w * 100)
+ let ratio= x / w * 100
if($(".handle").hasClass("dragging")) {
$("body").addClass("user-select-none")
requestAnimationFrame(function() {
$("#markdown-preview").width(ratio+'%')
})
+
+ if($("#markdown-page img")[0].getBoundingClientRect().top < $("body")[0].getBoundingClientRect().top
+ || $("#markdown-page img")[0].getBoundingClientRect().bottom > $("body")[0].getBoundingClientRect().bottom){
+ $("#markdown-preview").addClass("overtake")
+ }else {
+ $("#markdown-preview").removeClass("overtake")
+ }
}
})
markdown: function() {
this.editor = new Editor({
el: document.querySelector('#editor'),
- initialEditType: 'markdown',
+ initialEditType: 'wysiwyg',
previewStyle: 'vertical'
});