editor tabIndex

This commit is contained in:
life
2014-05-13 16:47:06 +08:00
parent 077e702ba1
commit 418c70bad2
5 changed files with 27 additions and 9 deletions

View File

@ -464,7 +464,7 @@ function log(o) {
</div>
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
</div>
@ -488,7 +488,7 @@ function log(o) {
</div>
</div>
<!-- 由此可以算高度 -->
<div id="editorContent" name="editorContent">
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
</div>
</div>
@ -501,7 +501,7 @@ function log(o) {
<div class="clearfix" id="mdEditorPreview">
<div id="left-column" class="pull-left">
<div id="wmd-panel-editor" class="wmd-panel-editor">
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false"></textarea>
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false" tabindex="3"></textarea>
</div>
</div>
<div id="right-column" class="pull-right">

View File

@ -464,7 +464,7 @@ function log(o) {
</div>
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
</div>
@ -488,7 +488,7 @@ function log(o) {
</div>
</div>
<!-- 由此可以算高度 -->
<div id="editorContent" name="editorContent">
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
</div>
</div>
@ -501,7 +501,7 @@ function log(o) {
<div class="clearfix" id="mdEditorPreview">
<div id="left-column" class="pull-left">
<div id="wmd-panel-editor" class="wmd-panel-editor">
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false"></textarea>
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false" tabindex="3"></textarea>
</div>
</div>
<div id="right-column" class="pull-right">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -270,15 +270,33 @@ ajaxPostJson(
*/
//-----------------
// 切换编辑器时要修改tabIndex
function editorIframeTabindex(index) {
var $i = $("#editorContent_ifr");
if($i.size() == 0) {
setTimeout(function() {
editorIframeTabindex(index);
}, 100);
} else {
$i.attr("tabindex", index);
}
}
//切换编辑器
function switchEditor(isMarkdown) {
// 富文本永远是2
if(!isMarkdown) {
$("#editor").show();
$("#mdEditor").css("z-index", 1);
// 刚开始没有
editorIframeTabindex(2);
$("#wmd-input").attr("tabindex", 3);
} else {
$("#mdEditor").css("z-index", 3).show();
editorIframeTabindex(3);
$("#wmd-input").attr("tabindex", 2);
}
}