tinymce.dom.BookmarkManager

This class handles selection bookmarks.

Constructors

name summary defined by
BookmarkManager() Constructs a new BookmarkManager instance for a specific selection instance. tinymce.dom.BookmarkManager

Methods

name summary defined by
getBookmark() Returns a bookmark location for the current selection. This bookmark object can then be used to restore the selection after some content modification to the document. tinymce.dom.BookmarkManager
isBookmarkNode() Returns true/false if the specified node is a bookmark node or not. tinymce.dom.BookmarkManager
moveToBookmark() Restores the selection to the specified bookmark. tinymce.dom.BookmarkManager

Constructors

BookmarkManager

public constructor function BookmarkManager(selection:tinymce.dom.Selection)

Constructs a new BookmarkManager instance for a specific selection instance.

Parameters

Methods

getBookmark

getBookmark(type:Number, normalized:Boolean):Object

Returns a bookmark location for the current selection. This bookmark object can then be used to restore the selection after some content modification to the document.

Examples
// Stores a bookmark of the current selection
var bm = tinymce.activeEditor.selection.getBookmark();

tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');

// Restore the selection bookmark
tinymce.activeEditor.selection.moveToBookmark(bm);
Parameters
Return value

isBookmarkNode

isBookmarkNode(node:DOMNode):Boolean

Returns true/false if the specified node is a bookmark node or not.

Parameters
Return value

moveToBookmark

moveToBookmark(bookmark:Object):Boolean

Restores the selection to the specified bookmark.

Examples
// Stores a bookmark of the current selection
var bm = tinymce.activeEditor.selection.getBookmark();

tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content');

// Restore the selection bookmark
tinymce.activeEditor.selection.moveToBookmark(bm);
Parameters
Return value

Can't find what you're looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.