hide metadata widget when not editing

This is probably only a quick fix but I didn't want to create an issue without code ...

When leaving the edit mode by pressing the cancel button the metadata editor stays open an you can continue editing.