Accessibility-improvement on store-state-changes

master
Eirik Th S 2021-06-27 22:35:02 +02:00
parent 7a53057c6e
commit fe7ae67f1e
1 changed files with 4 additions and 1 deletions

View File

@ -72,12 +72,15 @@ class Store {
if($(ev.currentTarget).hasClass('planningState')){
this.setState('planning');
this.selector.find(".newItemName").first().focus();
}
else if($(ev.currentTarget).hasClass('shoppingState')){
this.setState('shopping');
this.selector.find(".checkItems input").first().focus();
}
else if($(ev.currentTarget).hasClass('closedState')){
this.setState('closed');
this.selector.find(".removeStore").first().focus();
}
});
@ -100,7 +103,7 @@ class Store {
this.state = "planning";
this.selector.find('li:not(.checkedItem) .itemAmountButtons').slideDown(animTime);
this.selector.find('li:not(.checkedItem) .itemAmountText').slideUp(animTime);
this.selector.find('.checkedItem .itemAmountText').slideDown(animTime);
this.selector.find('.checkedItem .itemAmountText:not(.oneItem)').slideDown(animTime);
this.selector.find('.addItemFormWrapper').slideDown(animTime);
this.selector.find('.remItem').show();