Commit 18774f65 authored by Regis's avatar Regis

make tests pass - change a bit of logic

parent acc3ec6f
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
This was preventing turbolinks to make the request to the link clicked This was preventing turbolinks to make the request to the link clicked
Vue will always look at the VDOM element which is the button 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 - once the build link is clicked
- when someone clicks outside of the dropdown - when someone clicks outside of the dropdown
...@@ -27,12 +28,13 @@ ...@@ -27,12 +28,13 @@
- here we setTimeout to give enough time to initialize the request - here we setTimeout to give enough time to initialize the request
- but short enough that a subsequent click will reset that state - but short enough that a subsequent click will reset that state
*/ */
if (!e.currentTarget.attributes['aria-describedby']) {
setTimeout(() => { const areaExpanded = e.currentTarget.attributes['aria-expanded'];
this.request = false;
}, 100); if (areaExpanded && areaExpanded.textContent) {
return null; return setTimeout(() => (this.request = false), 100);
} }
if (this.request) return this.clearBuilds(); if (this.request) return this.clearBuilds();
return this.$http.get(this.stage.dropdown_path) return this.$http.get(this.stage.dropdown_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment