0
0

Improve performance

This commit is contained in:
syuilo 2018-10-20 06:42:19 +09:00
parent 0fe0b6d254
commit 5d3fe9599b
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -67,10 +67,10 @@ export default {
// flatten
const reservedKeys = concat(actions.map(a => a.patterns));
el.dataset.reservedKeys = JSON.stringify(reservedKeys);
el._misskey_reservedKeys = reservedKeys;
el._keyHandler = (e: KeyboardEvent) => {
const targetReservedKeys = JSON.parse(document.activeElement ? ((document.activeElement as any).dataset || {}).reservedKeys || '[]' : '[]');
const targetReservedKeys = document.activeElement ? ((document.activeElement as any)._misskey_reservedKeys || []) : [];
if (document.activeElement && ignoreElemens.some(el => document.activeElement.matches(el))) return;
for (const action of actions) {