Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
31af345b
Commit
31af345b
authored
Nov 07, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix prev button being misplaced
parent
fa2f052b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+16
-15
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+1
-1
No files found.
app/assets/javascripts/vue_pagination/index.js.es6
View file @
31af345b
...
...
@@ -3,16 +3,16 @@
((gl) => {
gl.VueGlPagination = Vue.extend({
data() {
return {
nslice: +this.pagenum,
};
},
props: [
'changepage',
'count',
'pagenum',
],
data() {
return {
nslice: +this.pagenum,
};
},
methods: {
pagenumberstatus(n) {
if (n - 1 === +this.pagenum) return 'active';
...
...
@@ -24,17 +24,20 @@
},
},
computed: {
dynamicpage() {
const section = [...Array(this.upcount).keys()];
section.shift();
this.nslice = +this.pagenum;
this.endcount = +this.pagenum + 5;
return section.slice(+this.pagenum, +this.pagenum + 5);
},
paginationsection() {
if (this.last < 6 && this.pagenum < 6) {
const pageArray = [...Array(6).keys()];
pageArray.shift();
return pageArray.slice(0, this.upcount);
}
const section = [...Array(this.upcount).keys()];
section.shift();
this.nslice = +this.pagenum;
this.endcount = +this.pagenum + 5;
return section.slice(+this.pagenum, +this.pagenum + 5);
return this.dynamicpage;
},
last() {
return Math.ceil(+this.count / 5);
...
...
@@ -54,7 +57,7 @@
template: `
<div class="gl-pagination">
<ul class="pagination clearfix" v-for='n in paginationsection'>
<li :class='prevstatus(n)' v-if='n - 1 ===
nslice
'>
<li :class='prevstatus(n)' v-if='n - 1 ===
1
'>
<span @click='changepage($event, {where: pagenum - 1})'>Prev</span>
</li>
<li :class='pagenumberstatus(n)' v-if='n >= 2'>
...
...
@@ -71,16 +74,14 @@
class="next"
v-if='(n === upcount || n === endcount) && pagenum !== last'
>
<span @click='changepage($event, {where: +pagenum + 1})'>
Next
</span>
<span @click='changepage($event,{where: +pagenum+1})'>Next</span>
</li>
<li v-if='n === upcount && upcount > 4 && endspread'>
<span class="gap">…</span>
</li>
<li
class="last"
v-if='(n === upcount || n === endcount) && pagenum !== last'
v-if='(n === upcount || n === endcount) &&
+
pagenum !== last'
>
<span @click='changepage($event, {where: last})'>Last »</span>
</li>
...
...
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
31af345b
...
...
@@ -34,7 +34,7 @@
<vue-pipelines
:scope='scope'
:store='store'
:count='
90
'
:count='
count
'
>
</vue-pipelines>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment