clearButton.addEventListener('click', (function(event) {
event.preventDefault();
- this._input.value = '';
- this._keyup();
+ this.reset();
}).bind(this));
inputAddon.appendChild(input);
this._fragment = null;
},
+ /**
+ * Resets the filter.
+ */
+ reset: function () {
+ this._input.value = '';
+ this._keyup();
+ },
+
/**
* Builds the item list and rebuilds the items' DOM for easier manipulation.
*
return Fake;
}
- var _callback, _iconList;
+ var _callback, _iconList, _itemListFilter;
var _icons = [];
/**
_iconList.innerHTML = html;
_iconList.addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
- new UiItemListFilter('fontAwesomeIcons', {
+ _itemListFilter = new UiItemListFilter('fontAwesomeIcons', {
callbackPrepareItem: function (item) {
var small = elBySel('small', item);
var text = small.textContent.trim();
}
});
}).bind(this),
+ onShow: function () {
+ _itemListFilter.reset();
+ },
title: Language.get('wcf.global.fontAwesome.selectIcon')
},
source: '<ul class="fontAwesomeIcons" id="fontAwesomeIcons"></ul>'