mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
Merge branch 'release' into develop
This commit is contained in:
@@ -242,7 +242,7 @@ export default {
|
||||
this.$root.$emit('bv::show::modal', 'challenge-modal');
|
||||
});
|
||||
},
|
||||
destroyed () {
|
||||
beforeDestroy () {
|
||||
this.$root.$off('habitica:clone-challenge');
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
button.btn.btn-primary(@click="equipItem()") {{ $t(isEquipped ? 'unequip' : 'equip') }}
|
||||
|
||||
div.clearfix(slot="modal-footer")
|
||||
|
||||
|
||||
</template>
|
||||
<style lang="scss">
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
div.clearfix(slot="modal-footer")
|
||||
</template>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@import '~client/assets/scss/colors.scss';
|
||||
@import '~client/assets/scss/modal.scss';
|
||||
|
||||
@@ -61,7 +59,6 @@
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
import markdownDirective from 'client/directives/markdown';
|
||||
|
||||
@@ -73,9 +70,6 @@
|
||||
},
|
||||
directives: {
|
||||
markdown: markdownDirective,
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
mounted () {
|
||||
this.$root.$on('hatchedPet::open', this.openDialog);
|
||||
|
||||
@@ -291,12 +291,18 @@ export default {
|
||||
this.runYesterDailies();
|
||||
|
||||
// Do not remove the event listener as it's live for the entire app lifetime
|
||||
document.addEventListener('mousemove', () => this.checkNextCron());
|
||||
document.addEventListener('touchstart', () => this.checkNextCron());
|
||||
document.addEventListener('mousedown', () => this.checkNextCron());
|
||||
document.addEventListener('keydown', () => this.checkNextCron());
|
||||
document.addEventListener('mousemove', this.checkNextCron);
|
||||
document.addEventListener('touchstart', this.checkNextCron);
|
||||
document.addEventListener('mousedown', this.checkNextCron);
|
||||
document.addEventListener('keydown', this.checkNextCron);
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
document.removeEventListener('mousemove', this.checkNextCron);
|
||||
document.removeEventListener('touchstart', this.checkNextCron);
|
||||
document.removeEventListener('mousedown', this.checkNextCron);
|
||||
document.removeEventListener('keydown', this.checkNextCron);
|
||||
},
|
||||
methods: {
|
||||
checkUserAchievements () {
|
||||
if (this.user.needsCron) return;
|
||||
|
||||
@@ -503,5 +503,8 @@
|
||||
this.backgroundUpdate = new Date();
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$root.$off('buyModal::boughtItem');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -388,5 +388,8 @@
|
||||
this.backgroundUpdate = new Date();
|
||||
});
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$root.$off('buyModal::boughtItem');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -135,11 +135,14 @@ export default {
|
||||
if (timeout) {
|
||||
let delay = this.notification.delay || 1500;
|
||||
delay += this.$store.state.notificationStore.length * 1000;
|
||||
setTimeout(() => {
|
||||
this.timer = setTimeout(() => {
|
||||
this.show = false;
|
||||
}, delay);
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
clearTimeout(this.timer);
|
||||
},
|
||||
watch: {
|
||||
show () {
|
||||
this.$store.dispatch('snackbars:remove', this.notification);
|
||||
|
||||
@@ -48,8 +48,8 @@ export default {
|
||||
this.$root.$emit('bv::show::modal', 'broken-task-modal');
|
||||
});
|
||||
},
|
||||
removed () {
|
||||
this.$root.$remove('handle-broken-task');
|
||||
beforeDestroy () {
|
||||
this.$root.$off('handle-broken-task');
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
|
||||
@@ -192,10 +192,7 @@ export default {
|
||||
this.castEnd(target, type, $event);
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', keyEvent => {
|
||||
if (keyEvent.keyCode !== 27) return;
|
||||
this.castCancel();
|
||||
});
|
||||
document.addEventListener('keyup', this.handleKeyUp);
|
||||
|
||||
// @TODO: should we abstract the drawer state/local store to a library and mixing combo? We use a similar pattern in equipment
|
||||
const spellDrawerState = getLocalSetting(CONSTANTS.keyConstants.SPELL_DRAWER_STATE);
|
||||
@@ -203,6 +200,10 @@ export default {
|
||||
this.$store.state.spellOptions.spellDrawOpen = false;
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.$root.$off('castEnd');
|
||||
document.removeEventListener('keyup', this.handleKeyUp);
|
||||
},
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
openStatus () {
|
||||
@@ -210,6 +211,10 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleKeyUp (keyEvent) {
|
||||
if (keyEvent.keyCode !== 27) return;
|
||||
this.castCancel();
|
||||
},
|
||||
drawerToggled (newState) {
|
||||
this.$store.state.spellOptions.spellDrawOpen = newState;
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
) {{ showAll ? $t('showLess') : $t('showMore') }}
|
||||
|
||||
div.fill-height(v-else)
|
||||
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user