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
Léo-Paul Géneau
gitlab-ce
Commits
ce996962
Commit
ce996962
authored
Jan 06, 2017
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add param_helper to utils - fix switch statement in pagination
parent
45b51e71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
app/assets/javascripts/lib/utils/param_helper.js.es6
app/assets/javascripts/lib/utils/param_helper.js.es6
+5
-0
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+6
-9
No files found.
app/assets/javascripts/
vue_pagination
/param_helper.js.es6
→
app/assets/javascripts/
lib/utils
/param_helper.js.es6
View file @
ce996962
/* eslint-disable no-param-reassign */
/* eslint-disable no-param-reassign */
((w) => {
((w) => {
/**
this will take in the `name` of the param you want to parse in the url
if the name does not exist this function will return `null`
otherwise it will return the value of the param key provided
*/
w.getParameterByName = (name) => {
w.getParameterByName = (name) => {
const url = window.location.href;
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
name = name.replace(/[[\]]/g, '\\$&');
...
...
app/assets/javascripts/vue_pagination/index.js.es6
View file @
ce996962
/* global Vue, gl */
/* global Vue, gl */
/* eslint-disable no-param-reassign, no-plusplus */
/* eslint-disable no-param-reassign, no-plusplus */
/
/= require ./param_helper.js.es6
/
*= require lib/utils/param_helper.js.es6 */
((gl) => {
((gl) => {
const PAGINATION_UI_BUTTON_LIMIT = 4;
const PAGINATION_UI_BUTTON_LIMIT = 4;
...
@@ -58,7 +58,6 @@
...
@@ -58,7 +58,6 @@
},
},
methods: {
methods: {
changePage(e) {
changePage(e) {
let pageNum = this.pageInfo.page;
let apiScope = gl.getParameterByName('scope');
let apiScope = gl.getParameterByName('scope');
if (!apiScope) apiScope = 'all';
if (!apiScope) apiScope = 'all';
...
@@ -70,23 +69,21 @@
...
@@ -70,23 +69,21 @@
case SPREAD:
case SPREAD:
break;
break;
case LAST:
case LAST:
pageNum = totalPages
;
this.change(totalPages, apiScope)
;
break;
break;
case NEXT:
case NEXT:
pageNum = nextPage
;
this.change(nextPage, apiScope)
;
break;
break;
case PREV:
case PREV:
pageNum = previousPage
;
this.change(previousPage, apiScope)
;
break;
break;
case FIRST:
case FIRST:
pageNum = 1
;
this.change(1, apiScope)
;
break;
break;
default:
default:
pageNum = +text
;
this.change(+text, apiScope)
;
break;
break;
}
}
this.change(pageNum, apiScope);
},
},
},
},
computed: {
computed: {
...
...
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