JavaScript:
!function($, window, document, _undefined) {
XF.UserTagClick = XF.Click.newHandler({
eventNameSpace: 'XFUserTagClick',
options: {
username: null
},
init: function()
{
if (!this.options.username)
{
console.error('Must be initialized with a data-user attribute.');
}
},
click: function(e)
{
e.preventDefault();
var html, username = '@' + $(e.target).data('username') + ', ';
XF.insertIntoEditor($('.js-editor').parent(), username, username);
},
});
XF.Click.register('userTag', 'XF.UserTagClick');
} (jQuery, window, document);
Last edited: