-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathLaunchpadButton.vue
More file actions
58 lines (56 loc) · 1.14 KB
/
LaunchpadButton.vue
File metadata and controls
58 lines (56 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<template>
<button
type="button"
class="btn btn-white"
:class="buttonDisabledClass"
:title="$t('Open Launchpad')"
v-b-tooltip.hover.viewport.d50="{ customClass: 'no-pointer-events' }"
data-cy="launchpad-button"
@mouseleave="handleMouseLeave"
@mouseover="handleMouseOver"
@click.prevent="handleOpenLaunchpad"
:disabled="disabled"
>
<i :class="iconOpen" />
</button>
</template>
<script>
export default {
props: {
disabled: {
type: Boolean,
default: false,
},
},
data() {
return {
iconOpen: 'fas fa-play',
};
},
computed: {
buttonDisabledClass() {
return this.disabled ? 'no-hover' : '';
},
},
methods: {
handleOpenLaunchpad() {
this.$emit('verifyLaunchpad', window.ProcessMaker.modeler.launchpad === null);
},
handleMouseOver() {
if (!this.disabled) {
this.iconOpen = 'fas fa-external-link-alt';
}
},
handleMouseLeave() {
if (!this.disabled) {
this.iconOpen = 'fas fa-play';
}
},
},
};
</script>
<style scoped>
.no-hover:hover {
background-color: transparent;
}
</style>