diff --git a/template/admin_tabs.tpl b/template/admin_tabs.tpl index 75eb83a..2ced7aa 100644 --- a/template/admin_tabs.tpl +++ b/template/admin_tabs.tpl @@ -80,6 +80,14 @@ if(dialog){ dialog.addEventListener('cancel',function(event){event.preventDefault();event.stopImmediatePropagation();closeAfterReset();},true); dialog.addEventListener('click',function(event){if(event.target===dialog){event.preventDefault();event.stopImmediatePropagation();closeAfterReset();}},true); + + // Every wizard POST explicitly preserves the open state before the + // browser leaves the page. Validation errors therefore return to the + // same wizard step instead of closing/resetting the dialog. + [].slice.call(dialog.querySelectorAll('form[data-bratonien-wizard-form]')).forEach(function(form){ + form.addEventListener('submit',function(){setOpen(true);},true); + }); + try{if(sessionStorage.getItem(storageKey)==='1')showWizard();}catch(e){} } }