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
fc5eb253
Commit
fc5eb253
authored
Nov 17, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor store
parent
46898c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+11
-5
No files found.
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
fc5eb253
...
...
@@ -34,7 +34,13 @@
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum, url) {
Vue.activeResources = 0;
const setVueResources = () => { Vue.activeResources = 1; };
const resetVueResources = () => { Vue.activeResources = 0; };
const addToVueResources = () => { Vue.activeResources += 1; };
const subtractFromVueResources = () => { Vue.activeResources -= 1; };
resetVueResources(); // set Vue.resources to 0
const updatePipelineNums = (total, running) => {
document.querySelector('.js-totalbuilds-count').innerHTML = total;
document.querySelector('.js-running-count').innerHTML = running;
...
...
@@ -42,9 +48,9 @@
const resourceChecker = () => {
if (Vue.activeResources === 0) {
Vue.activeResources = 1
;
setVueResources()
;
} else {
Vue.activeResources += 1
;
addToVueResources()
;
}
};
...
...
@@ -57,7 +63,7 @@
Vue.set(this, 'count', res.count);
updatePipelineNums(this.count.all, this.count.running_or_pending);
this.pageRequest = false;
Vue.activeResources -= 1
;
subtractFromVueResources()
;
}, () => new Flash(
'Something went wrong on our end.'
));
...
...
@@ -71,7 +77,7 @@
Vue.set(this, 'pipelines', p.updatePipelines(res));
Vue.set(this, 'count', res.count);
updatePipelineNums(this.count.all, this.count.running_or_pending);
Vue.activeResources -= 1
;
subtractFromVueResources()
;
}, () => new Flash(
'Something went wrong on our end.'
));
...
...
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