');
$( "#menu-search-field" ).keyup(function() {
var search = $( "#menu-search-field" ).val();
foundLi = $('#searchable-items').children('li:icontains('+ search +')');
$('#menu-results').remove();
if(foundLi.length > 0 && search.length > 0) {
var arr = foundLi.clone();
console.log(arr);
$('#in-menu-search-li').append('');
$('#menu-results').html(arr);
} else {
$('#menu-results').remove();
}
});
$('[data-toggle="tooltip"]').tooltip();
var breaking_news_wrapper = $('.breaking-news-wrapper');
$('#breaking-list').newsTicker({
row_height: 52,
max_rows: 1,
duration: 10000,
prevButton: $('#breaking-prev'),
nextButton: $('#breaking-next')
});
$('.close-breaking').on('click', function() {
breaking_news_wrapper.fadeOut(1000);
breaking_news_wrapper.data('visible', 0);
});
var timeoutHandle = null;
function breakingInit() {
$.getJSON( 'https://english.almanar.com.lb/ajax/breaking_news.php', function( data ) {
if(data.breaking_news[0] != null) {
if(data.last_id != breaking_news_wrapper.data('last_id')) {
$('.breaking-body').fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);
breaking_news_wrapper.data('last_id', data.last_id);
var template = $('#breaking-items').html();
Mustache.parse(template); // optional, speeds up future uses
var rendered = Mustache.render(template, data);
if(breaking_news_wrapper.data('visible') == 0) {
$('.breaking-news-wrapper').slideDown(1000);
breaking_news_wrapper.data('visible', 1);
} else {
clearTimeout(timeoutHandle);
}
$('#breaking-list').html(rendered);
timeoutHandle = setTimeout(function() {
breaking_news_wrapper.slideUp(1000);
breaking_news_wrapper.data('visible', 0);
}, 60 * 30 * 1000);
}
}
});
}
breakingInit();
setInterval(breakingInit, 60 * 1000);
});
})(jQuery);
{{#breaking_news}}
{{.}} {{/breaking_news}} ');
}
});
return false;
});
// setTimeout(function() {
jQuery('#main, #sidebar').theiaStickySidebar({});
// }, 1000);
});
})(jQuery);