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
Boxiang Sun
gitlab-ce
Commits
286b96f0
Commit
286b96f0
authored
Nov 06, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a lot more progress on pagination :)
parent
be146a4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+7
-6
No files found.
app/assets/javascripts/vue_pagination/index.js.es6
View file @
286b96f0
...
...
@@ -34,6 +34,7 @@
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);
},
last() {
...
...
@@ -44,17 +45,17 @@
},
endspread() {
if (+this.pagenum < this.last && +this.pagenum > 5) return true;
return false
return false
;
},
begspread() {
if (+this.pagenum > 5 && +this.pagenum < this.last) return true;
return false
return false
;
},
},
template: `
<div class="gl-pagination">
<ul class="pagination clearfix" v-for='n in paginationsection'>
<li :class='prevstatus(n)' v-if='n
=== 1 || n
- 1 === nslice'>
<li :class='prevstatus(n)' v-if='n - 1 === nslice'>
<span @click='changepage($event, {where: pagenum - 1})'>Prev</span>
</li>
<li :class='pagenumberstatus(n)' v-if='n >= 2'>
...
...
@@ -67,15 +68,15 @@
<li v-if='n === upcount && upcount > 4 && begspread'>
<span class="gap">…</span>
</li>
<li class="next" v-if='
n === upcount
&& pagenum !== last'>
<span @click='changepage($event, {where: pagenum + 1})'>
<li class="next" v-if='
(n === upcount || n === endcount)
&& pagenum !== last'>
<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
&& pagenum !== last'>
<li class="last" v-if='
(n === upcount || n === endcount)
&& pagenum !== last'>
<span @click='changepage($event, {where: last})'>Last »</span>
</li>
</ul>
...
...
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