* is initialized!
*/
WCF.Message.UserMention = Class.extend({
+ /**
+ * current caret position
+ * @var DOMRange
+ */
+ _caretPosition: null,
+
/**
* name of the class used to get the user suggestions
* @var string
*/
_mentionStart: '',
+ /**
+ * redactor instance object
+ * @var $.Redactor
+ */
_redactor: null,
/**
* @param object event
*/
_click: function(event) {
+ // restore caret position
+ this._redactor.replaceRangesWith(this._caretPosition);
+
this._setUsername($(event.currentTarget).data('username'));
},
// restore caret position
this._redactor.replaceRangesWith($orgRange);
+ this._caretPosition = $orgRange;
return $offsets;
},