Answer the question
In order to leave comments, you need to log in
How to hide smart filter first?
As I understand it, this code always works when the page has just loaded
JCSmartFilter.prototype.postHandler = function (result, fromCache)
{
var hrefFILTER, url, curProp;
var modef = BX('modef');
var modef_num = BX('modef_num');
if (!!result && !!result.ITEMS)
{
for(var popupId in this.popups)
{
if (this.popups.hasOwnProperty(popupId))
{
this.popups[popupId].destroy();
}
}
this.popups = [];
for(var PID in result.ITEMS)
{
if (result.ITEMS.hasOwnProperty(PID))
{
this.updateItem(PID, result.ITEMS[PID]);
}
}
if (!!modef && !!modef_num)
{
modef_num.innerHTML = result.ELEMENT_COUNT;
hrefFILTER = BX.findChildren(modef, {tag: 'A'}, true);
if (result.FILTER_URL && hrefFILTER)
{
hrefFILTER[0].href = BX.util.htmlspecialcharsback(result.FILTER_URL);
}
if (result.FILTER_AJAX_URL && result.COMPONENT_CONTAINER_ID)
{
BX.unbindAll(hrefFILTER[0]);
BX.bind(hrefFILTER[0], 'click', function(e)
{
url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
return BX.PreventDefault(e);
});
}
if (result.INSTANT_RELOAD && result.COMPONENT_CONTAINER_ID)
{
url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL);
BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID);
}
else
{
if (modef.style.display === 'none')
{
modef.style.display = 'inline-block';
}
if (this.viewMode == "VERTICAL")
{
curProp = BX.findChild(BX.findParent(this.curFilterinput, {'class':'bx-filter-parameters-box'}), {'class':'bx-filter-container-modef'}, true, false);
curProp.appendChild(modef);
}
if (result.SEF_SET_FILTER_URL)
{
this.bindUrlToButton('set_filter', result.SEF_SET_FILTER_URL);
}
}
}
}
if (this.sef)
{
var set_filter = BX('set_filter');
set_filter.disabled = false;
}
if (!fromCache && this.cacheKey !== '')
{
this.cache[this.cacheKey] = result;
}
this.cacheKey = '';
};
if (modef.style.display === 'none')
{
modef.style.display = 'inline-block';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question