[block] Override on_mode_change to disable edit mode if leaving mode
This commit is contained in:
parent
82a32994d6
commit
eb6528ee1b
10
block.py
10
block.py
@ -480,3 +480,13 @@ class BlockView(view.View):
|
||||
return None
|
||||
|
||||
return key
|
||||
|
||||
async def on_mode_change(self, newmode):
|
||||
""" Overrides view.View to set the edit mode inactive. """
|
||||
if newmode != self._mode_name:
|
||||
self._edit_mode = False
|
||||
self._visible = False
|
||||
return
|
||||
|
||||
self._visible = True
|
||||
await self._draw_if_visible()
|
||||
|
Loading…
Reference in New Issue
Block a user