js 优化

* 标题按tab切换到内容
* 左侧最小化用css控制
* resize markdown editor v2
* Ace剪切导致行数减少
* 删除不要的代码
This commit is contained in:
lealife
2015-11-22 22:58:38 +08:00
parent bee65eb36d
commit 8301a1e515
5 changed files with 69 additions and 91 deletions

View File

@ -345,22 +345,6 @@ function getVendorPrefix() {
//-----------------
// 切换编辑器时要修改tabIndex
function editorIframeTabindex(index) {
var $i = $("#editorContent");
// var $i = $("#editorContent_ifr");
// if($i.size() == 0) {
$i.attr("tabindex", index);
setTimeout(function() {
$i.attr("tabindex", index);
}, 500);
setTimeout(function() {
$i.attr("tabindex", index);
}, 1000);
// } else {
// $i.attr("tabindex", index);
// }
}
//切换编辑器
LEA.isM = false;
LEA.isMarkdownEditor = function() {
@ -374,19 +358,14 @@ function switchEditor(isMarkdown) {
$("#mdEditor").css("z-index", 1).hide();
// 刚开始没有
editorIframeTabindex(2);
$("#wmd-input").attr("tabindex", 3);
$("#leanoteNav").show();
} else {
$("#mdEditor").css("z-index", 3).show();
editorIframeTabindex(3);
$("#wmd-input").attr("tabindex", 2);
$("#leanoteNav").hide();
}
}
// editor 设置内容
// 可能是tinymce还没有渲染成功
var previewToken = "<div style='display: none'>FORTOKEN</div>"