collection-crud/public/js/app.js

22 lines
582 B
JavaScript

$(document).foundation();
(function() {
// Disable weird scrolling behavior on input[type=number] fields
// Based on https://stackoverflow.com/questions/9712295/disable-scrolling-on-input-type-number/38589039#38589039
document.addEventListener('wheel', () => {
if (document.activeElement !== null && document.activeElement['type'] === 'number') {
document.activeElement['blur']()
}
})
let tables = document.querySelectorAll('table.sortable');
let i = 0;
let len = tables.length;
if (len > 0) {
for (;i < len; i++) {
tsorter.create(tables[i], 1);
}
}
}());