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

@@ -0,0 +1,11 @@
let Footer = {
view: function() {
return {tag: '<', children: `<div class="row mt-3 py-3 bg-light">
<div class="col-md-1"></div>
<div class="col-md-10">
&copy; <a href="https://specialistoff.net/" target="_blank">RemiZOffAlex</a>
</div>
<div class="col-md-1"></div>
</div>`}
}
};

View File

@@ -1,4 +1,5 @@
{% include '/components/backtotop.js' %}
{% include '/components/filter.js' %}
{% include '/components/footer.js' %}
{% include '/components/order_by.js' %}
{% include '/components/pagination.js' %}

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;
})()
),