diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-12 17:06:09 -0500 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-12 17:06:09 -0500 |
commit | 18774f65a19bdd1be08c3d36916bbca36dfcd2ae (patch) | |
tree | a1792f01cabac199a0351e6e7f9f45c9e03602f0 /app | |
parent | acc3ec6fb26ce2c1dabdd07f7e4848d0eee6e143 (diff) | |
download | gitlab-ce-18774f65a19bdd1be08c3d36916bbca36dfcd2ae.tar.gz |
make tests pass - change a bit of logic
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_pipelines_index/stage.js.es6 | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_pipelines_index/stage.js.es6 b/app/assets/javascripts/vue_pipelines_index/stage.js.es6 index 96a2b099843..f0291ee7826 100644 --- a/app/assets/javascripts/vue_pipelines_index/stage.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/stage.js.es6 @@ -19,7 +19,8 @@ This was preventing turbolinks to make the request to the link clicked Vue will always look at the VDOM element which is the button - It has a special attribute 'aria-describedby' which will not exist: + It has a special attribute 'aria-expanded': + - which will let us know if it is expanded - once the build link is clicked - when someone clicks outside of the dropdown @@ -27,12 +28,13 @@ - here we setTimeout to give enough time to initialize the request - but short enough that a subsequent click will reset that state */ - if (!e.currentTarget.attributes['aria-describedby']) { - setTimeout(() => { - this.request = false; - }, 100); - return null; + + const areaExpanded = e.currentTarget.attributes['aria-expanded']; + + if (areaExpanded && areaExpanded.textContent) { + return setTimeout(() => (this.request = false), 100); } + if (this.request) return this.clearBuilds(); return this.$http.get(this.stage.dropdown_path) |