[block] Override on_mode_change to disable edit mode if leaving mode

This commit is contained in:
Daniel Edgecumbe 2017-10-01 23:36:17 +01:00
parent 82a32994d6
commit eb6528ee1b

View File

@ -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()