BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
status.js.es6
app/assets/javascripts/vue_pipelines_index/status.js.es6
+1
-1
store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+5
-14
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 @@
...
@@ -18,7 +18,7 @@
},
},
detailsPath() {
detailsPath() {
const { status } = this.pipeline.details;
const { status } = this.pipeline.details;
return status.
path ? status.
path : '#';
return status.
details_path ? status.details_
path : '#';
},
},
},
},
template: `
template: `
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
520e27d1
/* global gl, Flash */
/* global gl, Flash */
/* eslint-disable no-param-reassign, no-underscore-dangle */
/* eslint-disable no-param-reassign, no-underscore-dangle */
/*= require vue_realtime_listener/index.js */
((gl) => {
((gl) => {
const pageValues = headers => ({
const pageValues = headers => ({
perPage: +headers['X-Per-Page'],
perPage: +headers['X-Per-Page'],
...
@@ -49,21 +51,10 @@
...
@@ -49,21 +51,10 @@
startTimeLoops();
startTimeLoops();
const removeTimeIntervals = () => clearInterval(this.timeLoopInterval);
const removeIntervals = () => clearInterval(this.timeLoopInterval);
const startIntervalLoops = () => startTimeLoops();
const startIntervals = () => startTimeLoops();
const removeAll = () => {
removeTimeIntervals();
window.removeEventListener('beforeunload', removeTimeIntervals);
window.removeEventListener('focus', startIntervalLoops);
window.removeEventListener('blur', removeTimeIntervals);
document.removeEventListener('page:fetch', removeAll);
};
window.addEventListener('beforeunload', removeTimeIntervals);
gl.VueRealtimeListener(removeIntervals, startIntervals);
window.addEventListener('focus', startIntervalLoops);
window.addEventListener('blur', removeTimeIntervals);
document.addEventListener('page:fetch', removeAll);
}
}
};
};
})(window.gl || (window.gl = {}));
})(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