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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2ecb65b8
Commit
2ecb65b8
authored
Dec 08, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract param helper to pagination dir
parent
bff8e5ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
23 deletions
+18
-23
app/assets/javascripts/vue_pagination/index.js.es6
app/assets/javascripts/vue_pagination/index.js.es6
+3
-11
app/assets/javascripts/vue_pagination/param_helper.js.es6
app/assets/javascripts/vue_pagination/param_helper.js.es6
+13
-0
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+2
-12
No files found.
app/assets/javascripts/vue_pagination/index.js.es6
View file @
2ecb65b8
/* global Vue, gl */
/* eslint-disable no-param-reassign, no-plusplus */
//= require ./param_helper.js.es6
((gl) => {
const PAGINATION_UI_BUTTON_LIMIT = 4;
const SPREAD = '...';
...
...
@@ -9,16 +11,6 @@
const FIRST = '<< First';
const LAST = 'Last >>';
const getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
gl.VueGlPagination = Vue.extend({
props: [
'change',
...
...
@@ -27,7 +19,7 @@
methods: {
changepage(e) {
let pagenum = this.pageInfo.page;
let apiScope = getParameterByName('scope');
let apiScope = g
l.g
etParameterByName('scope');
if (!apiScope) apiScope = 'all';
...
...
app/assets/javascripts/vue_pagination/param_helper.js.es6
0 → 100644
View file @
2ecb65b8
/* eslint-disable no-param-reassign */
((w) => {
w.getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
2ecb65b8
...
...
@@ -2,16 +2,6 @@
/* eslint-disable no-param-reassign, no-bitwise*/
((gl) => {
const getParameterByName = (name) => {
const url = window.location.href;
name = name.replace(/[[\]]/g, '\\$&');
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);
const results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
};
gl.VuePipelines = Vue.extend({
components: {
runningPipeline: gl.VueRunningPipeline,
...
...
@@ -38,8 +28,8 @@
},
props: ['scope', 'store'],
created() {
const pagenum = getParameterByName('p');
const scope = getParameterByName('scope');
const pagenum = g
l.g
etParameterByName('p');
const scope = g
l.g
etParameterByName('scope');
if (pagenum) this.pagenum = pagenum;
if (scope) this.apiScope = scope;
this.store.fetchDataLoop.call(this, Vue, this.pagenum, this.scope, this.apiScope);
...
...
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