mirror of
https://github.com/leanote/desktop-app.git
synced 2025-12-12 02:01:28 +08:00
轻量编辑器切换完成; writting美化
pasteImage在page.js中完成. 因为wmd-input总要是替换, 所以绑定left-column
This commit is contained in:
@@ -214,7 +214,7 @@ var openContextmenu = function (e, canCut2, canPaste2) {
|
||||
canCut = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
menu.canCopy(selectionType === 'RANGE');
|
||||
|
||||
menu.canPaste(canPaste);
|
||||
@@ -230,7 +230,7 @@ var openContextmenu = function (e, canCut2, canPaste2) {
|
||||
menu.popup(e.originalEvent.x, e.originalEvent.y);
|
||||
};
|
||||
|
||||
$('#noteTitle, #searchNoteInput, #searchNotebookForList, #addTagInput, #wmd-input, #preview-contents, #editorContent, #presentation').on('contextmenu', openContextmenu);
|
||||
$('#noteTitle, #searchNoteInput, #searchNotebookForList, #addTagInput, #left-column, #preview-contents, #editorContent, #presentation').on('contextmenu', openContextmenu);
|
||||
$('body').on('contextmenu', '.history-content', function (e) {
|
||||
openContextmenu(e, false, false);
|
||||
});
|
||||
|
||||
@@ -232,7 +232,7 @@ var Resize = {
|
||||
|
||||
clearInterval(self.resizeMDInterval);
|
||||
self.resizeMDInterval = setTimeout(function () {
|
||||
MD.aceEditor && MD.aceEditor.resize();
|
||||
MD.resize && MD.resize();
|
||||
}, 50);
|
||||
}
|
||||
},
|
||||
@@ -240,17 +240,16 @@ var Resize = {
|
||||
// 设置宽度
|
||||
setMdColumnWidth: function(mdEditorWidth) {
|
||||
var self = this;
|
||||
if(mdEditorWidth > 100) {
|
||||
var allWidth = $('#note').width();
|
||||
if(mdEditorWidth > 100 && mdEditorWidth < allWidth - 80) {
|
||||
if(Writting.isWriting()) {
|
||||
UserInfo.MdEditorWidthForWritting = mdEditorWidth;
|
||||
} else {
|
||||
UserInfo.MdEditorWidth = mdEditorWidth;
|
||||
}
|
||||
|
||||
// log(mdEditorWidth)
|
||||
self.leftColumn.width(mdEditorWidth);
|
||||
self.rightColumn.css("left", mdEditorWidth);
|
||||
// self.mdSplitter.css("left", mdEditorWidth);
|
||||
}
|
||||
|
||||
// 这样, scrollPreview 才会到正确的位置
|
||||
@@ -621,7 +620,7 @@ $(function() {
|
||||
});
|
||||
|
||||
// markdown编辑器paste
|
||||
$('#wmd-input').on('paste', function(e) {
|
||||
$('#left-column').on('paste', function(e) {
|
||||
pasteImage(e);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user