tinymce 下拉tool save bookmark

This commit is contained in:
life
2015-11-01 11:06:21 +08:00
parent 377af3e26c
commit 67c3f8a5cd

View File

@@ -1027,13 +1027,20 @@ LEA.bookmark = null;
LEA.hasBookmark = false;
function saveBookmark() {
try {
/*
// 没有focus();
if (!document.activeElement || document.activeElement.getAttribute('id') != 'editorContent') {
LEA.hasBookmark = false;
console.log('not active');
return;
}
*/
LEA.bookmark = tinymce.activeEditor.selection.getBookmark(); // 光标, 为了处理后重新定位到那个位置
// 如果之前没有focus, 则会在文档开头设置bookmark, 添加一行, 不行.
// $p不是<p>, 很诡异
// 6-5
if(LEA.bookmark && LEA.bookmark.id) {
var $ic = $($("#editorContent_ifr").contents());
var $body = $ic.find("body");
var $body = $($("#editorContent").contents());
var $p = $body.children().eq(0);
// 找到
if($p.is("span")) {