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
520e27d1
Commit
520e27d1
authored
Dec 29, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add vue_realtime_listener function
parent
7be5c231
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
app/assets/javascripts/vue_pipelines_index/status.js.es6
app/assets/javascripts/vue_pipelines_index/status.js.es6
+1
-1
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+5
-14
app/assets/javascripts/vue_realtime_listener/index.js.es6
app/assets/javascripts/vue_realtime_listener/index.js.es6
+16
-0
No files found.
app/assets/javascripts/vue_pipelines_index/status.js.es6
View file @
520e27d1
...
...
@@ -18,7 +18,7 @@
},
detailsPath() {
const { status } = this.pipeline.details;
return status.
path ? status.
path : '#';
return status.
details_path ? status.details_
path : '#';
},
},
template: `
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
520e27d1
/* global gl, Flash */
/* eslint-disable no-param-reassign, no-underscore-dangle */
/*= require vue_realtime_listener/index.js */
((gl) => {
const pageValues = headers => ({
perPage: +headers['X-Per-Page'],
...
...
@@ -49,21 +51,10 @@
startTimeLoops();
const removeTimeIntervals = () => clearInterval(this.timeLoopInterval);
const startIntervalLoops = () => startTimeLoops();
const removeAll = () => {
removeTimeIntervals();
window.removeEventListener('beforeunload', removeTimeIntervals);
window.removeEventListener('focus', startIntervalLoops);
window.removeEventListener('blur', removeTimeIntervals);
document.removeEventListener('page:fetch', removeAll);
};
const removeIntervals = () => clearInterval(this.timeLoopInterval);
const startIntervals = () => startTimeLoops();
window.addEventListener('beforeunload', removeTimeIntervals);
window.addEventListener('focus', startIntervalLoops);
window.addEventListener('blur', removeTimeIntervals);
document.addEventListener('page:fetch', removeAll);
gl.VueRealtimeListener(removeIntervals, startIntervals);
}
};
})(window.gl || (window.gl = {}));
app/assets/javascripts/vue_realtime_listener/index.js.es6
0 → 100644
View file @
520e27d1
(() => {
gl.VueRealtimeListener = (removeIntervals, startIntervals) => {
const removeAll = () => {
removeIntervals();
window.removeEventListener('beforeunload', removeIntervals);
window.removeEventListener('focus', startIntervals);
window.removeEventListener('blur', removeIntervals);
document.removeEventListener('page:fetch', removeAll);
};
window.addEventListener('beforeunload', removeIntervals);
window.addEventListener('focus', startIntervals);
window.addEventListener('blur', removeIntervals);
document.addEventListener('page:fetch', removeAll);
};
})(window.gl || (window.gl = {}));
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