R
ragtek
Guest
I'm having in the acp options some namefields, where i add via js the AutoComplete AcSingle class.
with this the autocomplete is working nice
if i do the same in the frontend via
it creates the inputfield, BUT it doesn't attach the Autocomplete Event...
what's wrong here?
Code:
//devtools: add.jsheader
!function($, window, document, _undefined) {
XenForo.NUNS = function($form) {
this.__construct($form);
};
XenForo.NUNS.prototype =
{
__construct: function($form) {
this.$conversationCheckBox = $('#ctrl_optionsragtek_NUNS_welcomeConversationActive_1');
this.Init();
},
addAutoComplete:function($element, Single) {
$classes = 'AutoComplete';
$classes2 = 'AutoComplete AcSingle'; // todo
if (Single) {
$cl = $classes2;
}
else {
$cl = $classes;
}
$element.addClass($cl);
},
...
Init: function() {
$conversationcb = this.$conversationCheckBox;
this.addAutoComplete($('#ctrl_optionsragtek_NUNS_welcomeConversationSender'), true);
....
if i do the same in the frontend via
Code:
$input = $('<input type="text" name="watched_username" autocomplete="off"/>');
$input.addClass('textCtrl AutoComplete AcSingle');
$input.xfInsert('appendTo', $title.parent().parent().after());
what's wrong here?