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 @@
...
@@ -3,16 +3,16 @@
((gl) => {
((gl) => {
gl.VueGlPagination = Vue.extend({
gl.VueGlPagination = Vue.extend({
data() {
return {
nslice: +this.pagenum,
};
},
props: [
props: [
'changepage',
'changepage',
'count',
'count',
'pagenum',
'pagenum',
],
],
data() {
return {
nslice: +this.pagenum,
};
},
methods: {
methods: {
pagenumberstatus(n) {
pagenumberstatus(n) {
if (n - 1 === +this.pagenum) return 'active';
if (n - 1 === +this.pagenum) return 'active';
...
@@ -24,17 +24,20 @@
...
@@ -24,17 +24,20 @@
},
},
},
},
computed: {
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() {
paginationsection() {
if (this.last < 6 && this.pagenum < 6) {
if (this.last < 6 && this.pagenum < 6) {
const pageArray = [...Array(6).keys()];
const pageArray = [...Array(6).keys()];
pageArray.shift();
pageArray.shift();
return pageArray.slice(0, this.upcount);
return pageArray.slice(0, this.upcount);
}
}
const section = [...Array(this.upcount).keys()];
return this.dynamicpage;
section.shift();
this.nslice = +this.pagenum;
this.endcount = +this.pagenum + 5;
return section.slice(+this.pagenum, +this.pagenum + 5);
},
},
last() {
last() {
return Math.ceil(+this.count / 5);
return Math.ceil(+this.count / 5);
...
@@ -54,7 +57,7 @@
...
@@ -54,7 +57,7 @@
template: `
template: `
<div class="gl-pagination">
<div class="gl-pagination">
<ul class="pagination clearfix" v-for='n in paginationsection'>
<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>
<span @click='changepage($event, {where: pagenum - 1})'>Prev</span>
</li>
</li>
<li :class='pagenumberstatus(n)' v-if='n >= 2'>
<li :class='pagenumberstatus(n)' v-if='n >= 2'>
...
@@ -71,16 +74,14 @@
...
@@ -71,16 +74,14 @@
class="next"
class="next"
v-if='(n === upcount || n === endcount) && pagenum !== last'
v-if='(n === upcount || n === endcount) && pagenum !== last'
>
>
<span @click='changepage($event, {where: +pagenum + 1})'>
<span @click='changepage($event,{where: +pagenum+1})'>Next</span>
Next
</span>
</li>
</li>
<li v-if='n === upcount && upcount > 4 && endspread'>
<li v-if='n === upcount && upcount > 4 && endspread'>
<span class="gap">…</span>
<span class="gap">…</span>
</li>
</li>
<li
<li
class="last"
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>
<span @click='changepage($event, {where: last})'>Last »</span>
</li>
</li>
...
...
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
31af345b
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<vue-pipelines
<vue-pipelines
:scope='scope'
:scope='scope'
:store='store'
:store='store'
:count='
90
'
:count='
count
'
>
>
</vue-pipelines>
</vue-pipelines>
</div>
</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