Skip to content

Commit

Permalink
chore(UI): effect disabled automatically on buttons that have the too…
Browse files Browse the repository at this point in the history
…ltip
  • Loading branch information
IvanM3x committed Sep 8, 2021
1 parent 37247b9 commit 7295eea
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 25 deletions.
5 changes: 3 additions & 2 deletions components/interactables/Button/Button.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<button
:class="`button is-button is-${size} is-${type} ${outlined ? 'is-outlined' : ''} is-${fullWidth ? 'full-width' : 'normal-width'} ${inactive ? 'is-inactive' : ''}`"
v-on:click="action" :disabled="loading">
<UiGlowingCursorArea :class="`${!glow ? 'hide' : ''}`">
v-on:click="action" :disabled="loading" ref="button">
<!-- {{$attrs['data-tooltip']}} -->
<UiGlowingCursorArea :hide="$attrs['data-tooltip'] ? true : false">
<!-- If the button is in the loading state -->
<div v-if="loading">
<!-- Loading Spinner -->
Expand Down
6 changes: 0 additions & 6 deletions components/interactables/Button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ export default Vue.extend({
*/
fullWidth: Boolean,
inactive: Boolean,
//glowing effetc
glow: {
type: Boolean,
default: false,
},
},
})
</script>
Expand Down
4 changes: 0 additions & 4 deletions components/tailored/core/sidebar/Sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
:icon="{ style: 'far', name: 'user-friends' }"
:action="() => $router.push('/friends/list')"
:text="$t('global.friends')"
:glow="true"
/>
<span :class="$route.path.includes('/friends/list') ? 'label tag-inverted' : 'label'">
14
Expand All @@ -45,7 +44,6 @@
:action="() => $router.push('/files/browse')"
:icon="{ style: 'far', name: 'folder' }"
:text="$t('global.files')"
:glow="true"
/>
</div>

Expand All @@ -57,7 +55,6 @@
:icon="{ style: 'far', name: 'comment-alt-lines' }"
:text="$t('global.messages')"
:action="() => $store.commit('showSidebarUsers', true)"
:glow="true"
/>
<InteractablesButton
full-width
Expand All @@ -66,7 +63,6 @@
:icon="{ style: 'far', name: 'users' }"
:text="$t('global.groups')"
:action="() => $store.commit('showSidebarUsers', false)"
:glow="true"
/>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion components/ui/GlowingCursorArea/GlowingCursorArea.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="custom-cursor-area" @mousemove="moveCursor" @mouseover="hideCursor = false" @mouseleave="hideCursor = true">
<div v-if="!hideCursor" id="custom-cursor" ref="point" :style="cursorPoint"></div>
<div v-if="!hideCursor && !hide" id="custom-cursor" ref="point" :style="cursorPoint"></div>
<slot />
</div>
10 changes: 5 additions & 5 deletions components/ui/GlowingCursorArea/GlowingCursorArea.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
> * {
pointer-events: none;
}
&.hide {
#custom-cursor {
display: none;
}
}
// &.hide {
// #custom-cursor {
// display: none;
// }
// }
}

#custom-cursor {
Expand Down
10 changes: 7 additions & 3 deletions components/ui/GlowingCursorArea/GlowingCursorArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import Vue from 'vue'
export default Vue.extend({
props: {
hide: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return { xChild: 0, yChild: 0, hideCursor: true }
},
Expand All @@ -21,9 +28,6 @@ export default Vue.extend({
this.yChild = e.clientY - bounds.top
},
},
mounted() {
// document.addEventListener('mousemove', this.moveCursor)
},
})
</script>
<style scoped lang="less" src="./GlowingCursorArea.less"></style>
4 changes: 0 additions & 4 deletions layouts/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default Vue.extend({
this.$Sounds.changeLevels(this.$store.state.audio.volume / 100)
this.$store.commit('setTypingUser', this.$mock.users[0])
},
updated() {
// this.scrollToBottom()
console.log(this.$store.state.ui)
},
methods: {
toggleModal() {
this.$store.commit('toggleModal', {
Expand Down

0 comments on commit 7295eea

Please sign in to comment.