Migrate to mithril.js

This commit is contained in:
2023-02-18 09:22:43 +03:00
parent 024d7fb10d
commit bdc8f8496f
79 changed files with 1697 additions and 149 deletions

View File

@@ -35,10 +35,6 @@ function Pagination(arguments) {
return data.page > 1;
};
function has_next() {
console.log('has_next');
console.log(data.page);
console.log(pages());
console.log(data.page < pages());
return data.page < pages();
};
function iter_pages() {
@@ -65,12 +61,11 @@ function Pagination(arguments) {
return {
data: data,
view: function(vnode) {
// console.log(data.page);
console.log('Pagination.view');
let result = [
m('div', {class: "row"},
m('div', {class: "col py-2 text-center"},
(function() {
// console.log(`pages: ${pages()}`)
if (pages()<=1) {
return m('button', {class: "btn btn-outline-secondary", type: "button", onclick: function() { data.clickHandler(1)}}, m('i', {class: "fa fa-refresh"}));
} else {
@@ -98,7 +93,6 @@ function Pagination(arguments) {
m('button', {type: "button", class: "btn btn-outline-secondary float-end", onclick: function() { handlePageSelected(data.page+1)}}, 'Следующая')
);
}
// console.log(`result: ${result}`)
return result;
})()
),