Migrate to mithril.js
This commit is contained in:
11
myapp/templates/components/footer.js
Normal file
11
myapp/templates/components/footer.js
Normal 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">
|
||||
© <a href="https://specialistoff.net/" target="_blank">RemiZOffAlex</a>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
</div>`}
|
||||
}
|
||||
};
|
||||
@@ -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' %}
|
||||
|
||||
@@ -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;
|
||||
})()
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user