code: function () {
          var me = this;
  
          if (!me.storedCursorPosition) {
              return;
          }
  
          var wwg_mode = false;
  
          var ed = tinymce.get(me.getInputId());
  
          if (me.wysiwygIntialized) {
              if (ed && !ed.isHidden()) {
                  wwg_mode = true;
              }
          }
  
          var ctrl = document.getElementById(me.getInputId());
  
          if (wwg_mode) {
              ed.selection.moveToBookmark(me.storedCursorPosition);
          }
          else if (ctrl) {
              ctrl.setSelectionRange(me.storedCursorPosition.start, me.storedCursorPosition.end);
          }
      }
docs: storeCurrentSelection -----------------------------------------------------------------