code: function () {
        var range = this.el.ownerDocument.getSelection().getRangeAt(0);
        var selection = range.cloneRange();
        selection.selectNodeContents(range.startContainer);
        return selection.toString().substring(0, range.startOffset);
      }
docs: Returns the string between the first character and the caret. Completer will be triggered with the result for start autocompleting.  Example  // Suppose the html is '<b>hello</b> wor|ld' and | is the caret. this.getTextFromHeadToCaret() // => ' wor'  // not '<b>hello</b> wor'