| Server IP : 54.36.91.62 / Your IP : 216.73.217.94 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nimes/media/com_comment/js/v6/components/ |
Upload File : |
'use strict'
var pagination = Vue.extend({
template: '#ccomment-pagination',
props: {
pagination: {
type: Object,
required: true
},
callback: {
type: Function,
required: true
},
options: {
type: Object
},
},
computed: {
array: function array () {
if (this.pagination.last_page <= 0) {
return []
}
var from = this.pagination.current_page - this.pagination.offset
if (from < 1) {
from = 1
}
var to = from + this.pagination.to
if (to >= this.pagination.last_page) {
to = this.pagination.last_page
}
var arr = []
while (from <= to) {
arr.push(from)
from++
}
return arr
},
config: function config () {
return Object.assign({
offset: 3,
alwaysShowPrevNext: true
}, this.options)
}
},
methods: {
showPrevious: function showPrevious () {
return this.config.alwaysShowPrevNext || this.pagination.current_page > 1
},
showNext: function showNext () {
return this.config.alwaysShowPrevNext || this.pagination.current_page < this.pagination.last_page
},
changePage: function changePage (page) {
if (this.pagination.current_page === page) {
return
}
this.$set(this.pagination, 'current_page', page)
this.callback()
}
}
})