写作模式切到可写状态, markdown切到可写时Md.onResize #13

This commit is contained in:
life
2015-05-10 00:59:28 +08:00
parent af0b2293b5
commit d6b35df9aa
5 changed files with 43 additions and 10 deletions

View File

@@ -342,11 +342,9 @@ function log(o) {
<div id="mceToolbarContainer"> <div id="mceToolbarContainer">
<div id="popularToolbar" <div id="popularToolbar"
style="position: absolute; right: 30px; left: 0"></div> style="position: absolute; right: 30px; left: 0"></div>
<a <a id="moreBtn">
style="dispaly: block; position: absolute; cursor: pointer; right: 10px; padding: 3px 10px" <i class="more-fa fa fa-angle-down"></i>
id="moreBtn"> </a>
<i class="more-fa fa fa-angle-down"></i>
</a>
</div> </div>
<!-- 查看信息 --> <!-- 查看信息 -->

View File

@@ -1793,7 +1793,8 @@ Note.toggleReadOnly = function() {
// console.log('((((((((((((((((((((((('); // console.log('(((((((((((((((((((((((');
// tinymce // tinymce
$('#editor').addClass('read-only'); var $editor = $('#editor');
$editor.addClass('read-only').removeClass('all-tool'); // 不要全部的
// 不可写 // 不可写
$('#editorContent').attr('contenteditable', false); $('#editorContent').attr('contenteditable', false);
@@ -1847,6 +1848,11 @@ Note.toggleWriteable = function() {
LeaAce.setAceReadOnly($(this), false); LeaAce.setAceReadOnly($(this), false);
}); });
} }
else {
if(MD) {
MD.onResize();
}
}
note.readOnly = false; note.readOnly = false;
Note.readOnly = false; Note.readOnly = false;

View File

@@ -30,6 +30,9 @@ var Writting = {
Resize.setMdColumnWidth(width); Resize.setMdColumnWidth(width);
// $("#mceToolbar").css("height", "40px"); // $("#mceToolbar").css("height", "40px");
resizeEditor(); resizeEditor();
// 切换到写模式
Note.toggleWriteable();
}, },
initNormal: function() { initNormal: function() {
Resize.setMdColumnWidth(UserInfo.MdEditorWidth); Resize.setMdColumnWidth(UserInfo.MdEditorWidth);
@@ -193,7 +196,7 @@ var Resize = {
UserInfo.NotebookWidth = notebookWidth; UserInfo.NotebookWidth = notebookWidth;
UserInfo.NoteListWidth = noteListWidth; UserInfo.NoteListWidth = noteListWidth;
console.log("??????????"); // console.log("??????????");
self.setTopDragWidth(); self.setTopDragWidth();
}, },
resize3Columns: function(event, isFromeIfr) { resize3Columns: function(event, isFromeIfr) {
@@ -397,9 +400,9 @@ function initEditor() {
// desk下有问题 // desk下有问题
// ed.on('keydown', Note.saveNote); // ed.on('keydown', Note.saveNote);
ed.on('keydown', function(e) { ed.on('keydown', function(e) {
// 如果是readony, 则不能做任何操作 var num = e.which ? e.which : e.keyCode;
if(Note.readOnly) { // 如果是readony, 则不能做任何操作, 除了复制
console.log('readonly'); if(Note.readOnly && !((e.ctrlKey || e.metaKey) && num == 67)) {
e.preventDefault(); e.preventDefault();
return; return;
} }

View File

@@ -1819,6 +1819,13 @@ img::selection {
text-align: center; text-align: center;
} }
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
/* /*
#starNotes li a, #starNotes li a,
.ztree li a, .ztree li a,
@@ -1830,6 +1837,12 @@ img::selection {
} }
*/ */
#moreBtn {
dispaly: block; position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
// readonly // readonly
.info-toolbar { .info-toolbar {

View File

@@ -1607,6 +1607,12 @@ img::selection {
line-height: 11px; line-height: 11px;
text-align: center; text-align: center;
} }
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
/* /*
#starNotes li a, #starNotes li a,
.ztree li a, .ztree li a,
@@ -1617,6 +1623,13 @@ img::selection {
cursor: default !important; cursor: default !important;
} }
*/ */
#moreBtn {
dispaly: block;
position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
.info-toolbar { .info-toolbar {
position: absolute; position: absolute;
top: 0; top: 0;