mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
@@ -1719,13 +1719,13 @@ Note.deleteNoteTag = function(item, tag) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Note.readOnly = true;
|
Note.readOnly = false; // 默认为false要好?
|
||||||
|
LEA.readOnly = false;
|
||||||
// 切换只读模式
|
// 切换只读模式
|
||||||
Note.toggleReadOnly = function() {
|
Note.toggleReadOnly = function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
var note = me.getCurNote();
|
var note = me.getCurNote();
|
||||||
|
|
||||||
// console.log('(((((((((((((((((((((((');
|
|
||||||
// tinymce
|
// tinymce
|
||||||
var $editor = $('#editor');
|
var $editor = $('#editor');
|
||||||
$editor.addClass('read-only').removeClass('all-tool'); // 不要全部的
|
$editor.addClass('read-only').removeClass('all-tool'); // 不要全部的
|
||||||
@@ -1748,6 +1748,9 @@ Note.toggleReadOnly = function() {
|
|||||||
$('#infoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
|
$('#infoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
|
||||||
$('#infoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
|
$('#infoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Note.readOnly = true;
|
||||||
|
LEA.readOnly = true;
|
||||||
|
|
||||||
if(note.readOnly) {
|
if(note.readOnly) {
|
||||||
return;
|
return;
|
||||||
@@ -1761,11 +1764,10 @@ Note.toggleReadOnly = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
note.readOnly = true;
|
note.readOnly = true;
|
||||||
Note.readOnly = true;
|
|
||||||
};
|
};
|
||||||
// 切换到编辑模式
|
// 切换到编辑模式
|
||||||
Note.toggleWriteable = function() {
|
LEA.toggleWriteable = Note.toggleWriteable = function() {
|
||||||
var me = this;
|
var me = Note;
|
||||||
|
|
||||||
// $('#infoToolbar').hide();
|
// $('#infoToolbar').hide();
|
||||||
$('#editor').removeClass('read-only');
|
$('#editor').removeClass('read-only');
|
||||||
@@ -1779,6 +1781,9 @@ Note.toggleWriteable = function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Note.readOnly = false;
|
||||||
|
LEA.readOnly = false;
|
||||||
|
|
||||||
if(!note.readOnly) {
|
if(!note.readOnly) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1794,9 +1799,7 @@ Note.toggleWriteable = function() {
|
|||||||
MD.onResize();
|
MD.onResize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
note.readOnly = false;
|
note.readOnly = false;
|
||||||
Note.readOnly = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 渲染列表
|
// 渲染列表
|
||||||
|
@@ -22,4 +22,18 @@ tinymce.PluginManager.add('image', function(editor, url) {
|
|||||||
onclick: showDialog,
|
onclick: showDialog,
|
||||||
stateSelector: 'img:not([data-mce-object])'
|
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