diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-17 21:36:56 +0300 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-17 21:36:56 +0300 |
commit | 96b7865b4bc7b63c0d414946c31ec431bb892533 (patch) | |
tree | 4772db039de10e4eadbcc800a55d8d573a568493 /app | |
parent | 28e77da976f1c1cd533099da1c4b447413b7e3af (diff) |
fix UI behaviour - only make new calls when button is clicked and dropdown is not displayed
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_pipelines_index/stage.js.es6 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_pipelines_index/stage.js.es6 b/app/assets/javascripts/vue_pipelines_index/stage.js.es6 index 34d75f01c9e..7e14acb83d3 100644 --- a/app/assets/javascripts/vue_pipelines_index/stage.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/stage.js.es6 @@ -11,7 +11,13 @@ }, props: ['stage', 'svgs', 'match'], methods: { - fetchBuilds() { + fetchBuilds(e) { + const areaExpanded = e.currentTarget.attributes['aria-expanded']; + + console.log('HIT'); + + if (areaExpanded && (areaExpanded.textContent === 'true')) return null; + return this.$http.get(this.stage.dropdown_path) .then((response) => { this.builds = JSON.parse(response.body).html; @@ -47,7 +53,7 @@ template: ` <div> <button - @click='fetchBuilds' + @click='fetchBuilds($event)' :class="triggerButtonClass" :title='stage.title' data-placement="top" |