b94dba3d9b
Fix bluring keyboard on Android Fix reading messages when page was blured Fix instant reading messages if there only one page of them Split dom functions
16 lines
451 B
TypeScript
16 lines
451 B
TypeScript
/*
|
|
* https://github.com/morethanwords/tweb
|
|
* Copyright (C) 2019-2021 Eduard Kuzmenko
|
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
|
*/
|
|
|
|
export default function toggleDisability(elements: HTMLElement[], disable: boolean) {
|
|
if(disable) {
|
|
elements.forEach(el => el.setAttribute('disabled', 'true'));
|
|
} else {
|
|
elements.forEach(el => el.removeAttribute('disabled'));
|
|
}
|
|
|
|
return () => toggleDisability(elements, !disable);
|
|
}
|