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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user