Revert "remove old js"

This reverts commit 0641db14
This commit is contained in:
vedatakd 2020-02-18 19:00:12 +03:00
parent 0641db14f5
commit 1a8560943e

View File

@ -1,3 +1,25 @@
const filter = {};
filter.checkUser = () => {
$.ajax({
type: 'get',
url: '/check_user',
success: function (response) {
if (response.success == true) {
$('#search-fav-modal').modal('toggle');
} else {
window.location.replace("/login");
}
},
error: function (err) {
reject(Error("It broke"));
}
});
};
$('.sort-by-item').on('click', function () {
let searchParams = new URLSearchParams(window.location.search);
var sort_by = searchParams.get('sort_by');
@ -15,8 +37,7 @@ $('.sort-by-item').on('click', function () {
} else {
goURL = url + "&sort_by=" + value;
}
console.log(goURL)
window.location.href = goURL;
window.location.replace(goURL);
});
@ -130,6 +151,10 @@ $(document).ready(function () {
$(value).prev('input').prop('checked', false);
$(this).hide();
});
$('#save-search').on('click', function () {
filter.checkUser();
});
});
$('.ad-info-right-bar-video').tooltip({