mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 23:55:50 +00:00
@@ -1719,13 +1719,13 @@ Note.deleteNoteTag = function(item, tag) {
|
||||
}
|
||||
};
|
||||
|
||||
Note.readOnly = true;
|
||||
Note.readOnly = false; // 默认为false要好?
|
||||
LEA.readOnly = false;
|
||||
// 切换只读模式
|
||||
Note.toggleReadOnly = function() {
|
||||
var me = this;
|
||||
var note = me.getCurNote();
|
||||
|
||||
// console.log('(((((((((((((((((((((((');
|
||||
// tinymce
|
||||
var $editor = $('#editor');
|
||||
$editor.addClass('read-only').removeClass('all-tool'); // 不要全部的
|
||||
@@ -1748,6 +1748,9 @@ Note.toggleReadOnly = function() {
|
||||
$('#infoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
|
||||
$('#infoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
|
||||
}
|
||||
|
||||
Note.readOnly = true;
|
||||
LEA.readOnly = true;
|
||||
|
||||
if(note.readOnly) {
|
||||
return;
|
||||
@@ -1761,11 +1764,10 @@ Note.toggleReadOnly = function() {
|
||||
}
|
||||
|
||||
note.readOnly = true;
|
||||
Note.readOnly = true;
|
||||
};
|
||||
// 切换到编辑模式
|
||||
Note.toggleWriteable = function() {
|
||||
var me = this;
|
||||
LEA.toggleWriteable = Note.toggleWriteable = function() {
|
||||
var me = Note;
|
||||
|
||||
// $('#infoToolbar').hide();
|
||||
$('#editor').removeClass('read-only');
|
||||
@@ -1779,6 +1781,9 @@ Note.toggleWriteable = function() {
|
||||
return;
|
||||
}
|
||||
|
||||
Note.readOnly = false;
|
||||
LEA.readOnly = false;
|
||||
|
||||
if(!note.readOnly) {
|
||||
return;
|
||||
}
|
||||
@@ -1794,9 +1799,7 @@ Note.toggleWriteable = function() {
|
||||
MD.onResize();
|
||||
}
|
||||
}
|
||||
|
||||
note.readOnly = false;
|
||||
Note.readOnly = false;
|
||||
};
|
||||
|
||||
// 渲染列表
|
||||
|
@@ -22,4 +22,18 @@ tinymce.PluginManager.add('image', function(editor, url) {
|
||||
onclick: showDialog,
|
||||
stateSelector: 'img:not([data-mce-object])'
|
||||
});
|
||||
|
||||
// 为解决在editor里拖动图片问题
|
||||
var dragStart = false;
|
||||
editor.on("dragstart", function(e) {
|
||||
// 只读模式下不能拖动
|
||||
if (LEA.readOnly) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
editor.on("dragend", function(e) {
|
||||
});
|
||||
editor.on("dragover", function(e) {
|
||||
});
|
||||
});
|
1
public/tinymce/plugins/image/plugin.min.js
vendored
1
public/tinymce/plugins/image/plugin.min.js
vendored
@@ -1 +0,0 @@
|
||||
tinymce.PluginManager.add("image",function(i,t){function e(){win=i.windowManager.open({title:"Insert/edit image",file:t+"/dialog.htm",width:550,height:345})}i.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:e,stateSelector:"img:not([data-mce-object])"})});
|
Reference in New Issue
Block a user