Fix the splitter in code and add it back

pull/1/head
yflory 7 years ago
parent 018f71df04
commit 0a656ca8d6

@ -437,35 +437,35 @@ define([
}); });
/*
// add the splitter // add the splitter
if (!$iframe.has('.cp-splitter').length) { if (!$('.cp-splitter').length) {
var $preview = $iframe.find('#previewContainer');
var splitter = $('<div>', { var splitter = $('<div>', {
'class': 'cp-splitter' 'class': 'cp-splitter'
}).appendTo($preview); }).appendTo($previewContainer);
$preview.on('scroll', function() { $preview.on('scroll', function() {
splitter.css('top', $preview.scrollTop() + 'px'); splitter.css('top', $preview.scrollTop() + 'px');
}); });
var $target = $iframe.find('.CodeMirror'); var $target = $('.CodeMirror');
splitter.on('mousedown', function (e) { splitter.on('mousedown', function (e) {
e.preventDefault(); e.preventDefault();
var x = e.pageX; var x = e.pageX;
var w = $target.width(); var w = $target.width();
$iframe.on('mouseup mousemove', function handler(evt) { $(window).on('mouseup mousemove', function handler(evt) {
if (evt.type === 'mouseup') { if (evt.type === 'mouseup') {
$iframe.off('mouseup mousemove', handler); $(window).off('mouseup mousemove', handler);
return; return;
} }
$target.css('width', (w - x + evt.pageX) + 'px'); $target.css('width', (w - x + evt.pageX) + 'px');
editor.refresh();
}); });
}); });
} }
*/
Cryptpad.removeLoadingScreen(); Cryptpad.removeLoadingScreen();
setEditable(!readOnly); setEditable(!readOnly);

Loading…
Cancel
Save