rundetail: make dropdown open on click

and not on hover
This commit is contained in:
Simone Gotti 2019-05-08 17:12:56 +02:00
parent 85406fad77
commit 07f5b69e9b
1 changed files with 13 additions and 4 deletions

View File

@ -16,11 +16,12 @@
</div> </div>
<div class="run-actions column is-2 is-pulled-right"> <div class="run-actions column is-2 is-pulled-right">
<div <div
class="dropdown is-hoverable is-right"
v-if="run.can_restart_from_scratch || run.can_restart_from_failed_tasks" v-if="run.can_restart_from_scratch || run.can_restart_from_failed_tasks"
class="dropdown is-right"
v-bind:class="{ 'is-active': dropdownActive }"
> >
<div class="dropdown-trigger"> <div class="dropdown-trigger">
<button class="button" aria-haspopup="true" aria-controls="dropdown-menu"> <button class="button" @click="toggleDropdown()">
<span>Restart</span> <span>Restart</span>
<span class="icon is-small"> <span class="icon is-small">
<i class="mdi mdi-restart" aria-hidden="true"></i> <i class="mdi mdi-restart" aria-hidden="true"></i>
@ -101,9 +102,14 @@ export default {
run: Object run: Object
}, },
data() { data() {
return {}; return {
dropdownActive: false
};
}, },
methods: { methods: {
toggleDropdown() {
this.dropdownActive = !this.dropdownActive;
},
stillRunning(run) { stillRunning(run) {
return run.result != "unknown" && run.phase == "running"; return run.result != "unknown" && run.phase == "running";
}, },
@ -135,7 +141,10 @@ export default {
return "unknown"; return "unknown";
}, },
stopRun: stopRun, stopRun: stopRun,
restartRun: restartRun restartRun(runid, fromStart) {
this.dropdownActive = false;
restartRun(runid, fromStart);
}
} }
}; };
</script> </script>