getNearestTextElement: function(direction, relativeToElement, includeInvisible) {
includeInvisible = includeInvisible !== undefined ? includeInvisible : false;
var selector = '[document-text-element]' + (includeInvisible ? '' : ':visible');
getNearestTextElement: function(direction, relativeToElement, includeInvisible) {
includeInvisible = includeInvisible !== undefined ? includeInvisible : false;
var selector = '[document-text-element]' + (includeInvisible ? '' : ':visible');
- return this.getDocumentElement(utils.nearestInDocumentOrder(selector, direction, relativeToElement.dom()[0]));
+ return this.getDocumentElement(utils.nearestInDocumentOrder(selector, direction, relativeToElement.dom[0]));
var _markAsCurrent = function(element) {
if(element instanceof documentElement.DocumentTextElement) {
this.wrapper.find('.current-text-element').removeClass('current-text-element');
var _markAsCurrent = function(element) {
if(element instanceof documentElement.DocumentTextElement) {
this.wrapper.find('.current-text-element').removeClass('current-text-element');
} else {
this.wrapper.find('.current-node-element').removeClass('current-node-element');
element._container().addClass('current-node-element');
} else {
this.wrapper.find('.current-node-element').removeClass('current-node-element');
element._container().addClass('current-node-element');
_moveCaretToTextElement: function(element, where) {
var range = document.createRange(),
_moveCaretToTextElement: function(element, where) {
var range = document.createRange(),