gpp/static/js/main.js

34 lines
644 B
JavaScript
Raw Normal View History

$(function () {
2019-08-03 22:44:57 +02:00
// todo
// change this with python normally
$('#id_boa-name').val($('#id_search_name').val());
// Events
$('[name=search_results]').on('change',
function (e) {
new_stay_0($(this));
})
$('#id_search_name').on('keyup',
function (e) {
$('#id_name').val($(this).val())
})
$('#switch_boat_search').on('click',
function (e) {
console.log('lol')
$('#new_boat').hide();
$('#search_boat').show();
})
// New Stay
// new_stay-0
function new_stay_0(elem) {
if (elem.val() < 0) {
$('#new_boat').show();
$('#search_boat').hide();
}
}
})