code: function (toEnd) {
              try {
                  var me = this,
                      rng = me.selection.getRange();
                  if (toEnd) {
                      var node = me.body.lastChild;
                      if(node && node.nodeType == 1 && !dtd.$empty[node.tagName]){
                          if(domUtils.isEmptyBlock(node)){
                              rng.setStartAtFirst(node)
                          }else{
                              rng.setStartAtLast(node)
                          }
                          rng.collapse(true);
                      }
                      rng.setCursor(true);
                  } else {
                      if(!rng.collapsed && domUtils.isBody(rng.startContainer) && rng.startOffset == 0){
  
                          var node = me.body.firstChild;
                          if(node && node.nodeType == 1 && !dtd.$empty[node.tagName]){
                              rng.setStartAtFirst(node).collapse(true);
                          }
                      }
  
                      rng.select(true);
  
                  }
                  this.fireEvent('focus selectionchange');
              } catch (e) {
              }
  
          }
docs: 让编辑器获得焦点，默认focus到编辑器头部
  @method focus
  @example
  ```javascript
  editor.focus()
  ```
   
  让编辑器获得焦点，toEnd确定focus位置
  @method focus
  @param { Boolean } toEnd 默认focus到编辑器头部，toEnd为true时focus到内容尾部
  @example
  ```javascript
  editor.focus(true)
  ```