gestiojeux/mainsite/static/js/gestiojeux.js
Guillaume Bertholon ccd8ee9cc9 Add game comments and rework game models
Models are now more structured for number of players, and durations can
be omitted.
2020-12-13 00:12:06 +01:00

25 lines
705 B
JavaScript

const MOBILE_NAV_PAGE_SIZE = 475; // px
const MOBILE_NAV_TOGGLE_TIME = 300; // msec
const TEXTAREA_MIN_SIZE = 120; // px
function mobile_nav_toggle() {
$("nav > a").slideToggle(MOBILE_NAV_TOGGLE_TIME);
}
$(window).resize(function () {
if(window.innerWidth > MOBILE_NAV_PAGE_SIZE) {
$("nav > a").show(0);
}
else {
$("nav > a").hide(0);
}
});
$('textarea').each(function () {
this.style.height = Math.max(this.scrollHeight, TEXTAREA_MIN_SIZE) + 'px';
this.style.resize = 'none';
this.style.overflowY = 'hidden';
}).on('input', function () {
this.style.height = 'auto';
this.style.height = Math.max(this.scrollHeight, TEXTAREA_MIN_SIZE) + 'px';
});