summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-02-27 16:28:17 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-02-27 16:28:17 -0600
commitc287c01821c4db4830dbdd5263907f08c2ed4cc4 (patch)
tree6e04c76ce5a71193bb492912c361636cb4861c26
parente658ca9665e70c07772fc927a88938895a7fb453 (diff)
downloadgitlab-ce-c287c01821c4db4830dbdd5263907f08c2ed4cc4.tar.gz
Remove unnecessary element checks
-rw-r--r--app/assets/javascripts/pipelines/pipeline_details_bundle.js108
1 files changed, 51 insertions, 57 deletions
diff --git a/app/assets/javascripts/pipelines/pipeline_details_bundle.js b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
index 1119a65e5be..6b26708148c 100644
--- a/app/assets/javascripts/pipelines/pipeline_details_bundle.js
+++ b/app/assets/javascripts/pipelines/pipeline_details_bundle.js
@@ -16,64 +16,58 @@ export default () => {
mediator.fetchPipeline();
- const pipelineGraphEl = document.querySelector('#js-pipeline-graph-vue');
- if (pipelineGraphEl) {
- // eslint-disable-next-line
- new Vue({
- el: pipelineGraphEl,
- components: {
- pipelineGraph,
- },
- data() {
- return {
- mediator,
- };
- },
- render(createElement) {
- return createElement('pipeline-graph', {
- props: {
- isLoading: this.mediator.state.isLoading,
- pipeline: this.mediator.store.state.pipeline,
- },
- });
- },
- });
- }
+ // eslint-disable-next-line
+ new Vue({
+ el: '#js-pipeline-graph-vue',
+ components: {
+ pipelineGraph,
+ },
+ data() {
+ return {
+ mediator,
+ };
+ },
+ render(createElement) {
+ return createElement('pipeline-graph', {
+ props: {
+ isLoading: this.mediator.state.isLoading,
+ pipeline: this.mediator.store.state.pipeline,
+ },
+ });
+ },
+ });
- const pipelineHeaderEl = document.querySelector('#js-pipeline-header-vue');
- if (pipelineHeaderEl) {
- // eslint-disable-next-line
- new Vue({
- el: pipelineHeaderEl,
- components: {
- pipelineHeader,
- },
- data() {
- return {
- mediator,
- };
+ // eslint-disable-next-line
+ new Vue({
+ el: '#js-pipeline-header-vue',
+ components: {
+ pipelineHeader,
+ },
+ data() {
+ return {
+ mediator,
+ };
+ },
+ created() {
+ eventHub.$on('headerPostAction', this.postAction);
+ },
+ beforeDestroy() {
+ eventHub.$off('headerPostAction', this.postAction);
+ },
+ methods: {
+ postAction(action) {
+ this.mediator.service.postAction(action.path)
+ .then(() => this.mediator.refreshPipeline())
+ .catch(() => Flash(__('An error occurred while making the request.')));
},
- created() {
- eventHub.$on('headerPostAction', this.postAction);
- },
- beforeDestroy() {
- eventHub.$off('headerPostAction', this.postAction);
- },
- methods: {
- postAction(action) {
- this.mediator.service.postAction(action.path)
- .then(() => this.mediator.refreshPipeline())
- .catch(() => Flash(__('An error occurred while making the request.')));
+ },
+ render(createElement) {
+ return createElement('pipeline-header', {
+ props: {
+ isLoading: this.mediator.state.isLoading,
+ pipeline: this.mediator.store.state.pipeline,
},
- },
- render(createElement) {
- return createElement('pipeline-header', {
- props: {
- isLoading: this.mediator.state.isLoading,
- pipeline: this.mediator.store.state.pipeline,
- },
- });
- },
- });
- }
+ });
+ },
+ });
};