$$("#tab-search" ).on('tab:show', function() {

  let dt2=get_localstorage('byid');

  let dt=dt2.data;  

  var $tabEl = $(this);

  //var tabId = $tabEl.attr('id');

  console.log('app tab_search ready');

  let search=document.querySelector("#tab-search > div.navbars > div > div.navbar-inner > div.subnavbar > form > div > div > input");

  search.addEventListener('change', function() {

    let q=this.value;

    console.log(q);

    if(q.length>3) {

      let res = search_data(dt, 'title', q)

      console.log(res.data)

      let r2=res.data;

      let dv = Object.keys(res.data);

      console.log(dv.length)

      console.log(dv[0])

      content =`<div class="post-list">`;    

      dv.forEach((v) => {

       content +=`

  <a href="/p/byid/${r2[v].id}" class="link post-horizontal">

    <div class="infos">`;

       if(r2[v].section) {

        content +=`<div class="post-category">${r2[v].section}</div>`;

       }      

       content +=`<div class="post-title">${r2[v].title}</div>

      <div class="post-date">`+InDayHour(r2[v].publish_at)+` ago </div>

    </div>

    <div class="post-image">

      <img src="${r2[v].img}" alt="">

    </div>

  </a>

    `;

      });

      content +=`</div>`;

      $("#search_tab_content").html(content);    

    }  

  });

})