xxxxxxxxxx
function (list, link, sortType, order) {
let results = list
.sortBy(function (i) {
return $(i).data('sortindex');
})
.reverse();
var sorter = CitatorSortFactory.createSorter(link + "-" + sortType, order);
results.sort(function (a, b) {
return sorter.sort(a, b);
});
return results.value();
}
xxxxxxxxxx
In most cases, it is not necessary to convert anything as
TypeScript is a superset of JavaScript and thus every valid
JS code is valid TS code.
xxxxxxxxxx
$(document).ready(function() {
$('.tog_btns').click(function() {
$('.sidebar').toggleClass('show');
$('main').toggleClass('full_width');
});
if ($(window).width() < 1380) {
$('.sidebar').removeClass('show')
}
});
xxxxxxxxxx
function foo()
{
$('.pre').hide();
if($('.superheader').parent('.active').length){
$('.sup').show();
$('.pre').hide();
// console.log('showing sup');
}
else{
// console.log('showing pre');
$('.pre').show();
$('.sup').hide();
}
setTimeout(foo, 500);
}
$(function(){
foo();
})
xxxxxxxxxx
(function ($) {
// Page loading animation
$(window).on('load', function () {
$('#js-preloader').addClass('loaded');
});
})(window.jQuery);