New player dialog and bugfixes
This commit is contained in:
@@ -49,7 +49,7 @@ Element.prototype.toggleClass = function(className) {
|
||||
NodeList.prototype.hasClass = function(className) {
|
||||
return this.item(0).classList.contains(className);
|
||||
}
|
||||
Element.prototype.toggleClass = function(className) {
|
||||
Element.prototype.hasClass = function(className) {
|
||||
this.classList.contains(className);
|
||||
}
|
||||
Node.prototype.offset = function() {
|
||||
@@ -102,3 +102,17 @@ Element.prototype.text = function(txt) {
|
||||
this.textContent = txt;
|
||||
}
|
||||
}
|
||||
NodeList.prototype.item = function (i) {
|
||||
return this[+i || 0];
|
||||
};
|
||||
NodeList.prototype.find = function(selector) {
|
||||
let result = [];
|
||||
this.forEach(function (elem, i) {
|
||||
let partial = elem.find(selector);
|
||||
result = result.concat([...partial]);
|
||||
});
|
||||
return Reflect.construct(Array, result, NodeList);
|
||||
}
|
||||
Element.prototype.find = function (selector) {
|
||||
return this.querySelectorAll(':scope ' + selector);
|
||||
}
|
||||
|
@@ -136,19 +136,27 @@ function spinner(show) {
|
||||
else $('#backdrop').removeClass('active');
|
||||
}
|
||||
|
||||
function modal(id) {
|
||||
$('body').addClass('dimmed');
|
||||
$(`#${id}.popup`).addClass('shown');
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
/*
|
||||
document.on('click', e => {
|
||||
if (!e.target.closest('.modal')) $('.modal').hide();
|
||||
})
|
||||
$('button.close').on('click', e => {
|
||||
let modal = e.target.closest('.popup');
|
||||
if (modal) {
|
||||
modal.removeClass('shown');
|
||||
$('body').removeClass('dimmed');
|
||||
}
|
||||
});
|
||||
$('.checkbox').on('click', e => {
|
||||
let chk = e.target.closest('.checkbox');
|
||||
chk.toggleClass('active');
|
||||
let checkbox = chk.find('input')[0];
|
||||
checkbox.checked = !checkbox.checked;
|
||||
});
|
||||
/* commented for now - do we want this?
|
||||
$('#dimmer').on('click', e => $('.popup').removeClass('shown');
|
||||
*/
|
||||
$('i.close.icon').on('click', e => {
|
||||
let modal = e.target.closest('.modal');
|
||||
if (modal) modal.modal(false);
|
||||
});
|
||||
$('.modal .actions .cancel').on('click', e => {
|
||||
e.target.closest('.modal').modal(false);
|
||||
});
|
||||
$('#dimmer').on('click', e => $('.modal').modal(false));
|
||||
});
|
||||
|
||||
|
@@ -7,7 +7,7 @@ onLoad(() => {
|
||||
|
||||
$('#cancel, #close').on('click', e => {
|
||||
e.preventDefault();
|
||||
if ($('#tournament-infos').hasClass('edit')) {
|
||||
if ($('#tournament-infos').hasClass('edit') && typeof(tour_id) !== 'undefined') {
|
||||
$('#tournament-infos').removeClass('edit')
|
||||
} else {
|
||||
document.location.href = '/index';
|
||||
|
9
view-webapp/src/main/webapp/js/tour-registration.inc.js
Normal file
9
view-webapp/src/main/webapp/js/tour-registration.inc.js
Normal file
@@ -0,0 +1,9 @@
|
||||
onLoad(() => {
|
||||
$('input.numeric').imask({
|
||||
mask: Number,
|
||||
scale: 0,
|
||||
min: 0,
|
||||
max: 4000
|
||||
});
|
||||
//$('')
|
||||
});
|
Reference in New Issue
Block a user