Как вначале скрыть умный фильтр?

Как я понял вот этот код всегда срабатывает когда страница только что подгрузилась
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';
            }

Мешает мне, только я не пойму как его вначале убирать. Если полностью убрать эти строки, то попап где показать результат не работает и даже его стайл убрать аналогично
  • Вопрос задан
  • 272 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы