1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-21 09:45:05 +02:00

use element classList to add animations (#1436)

This commit is contained in:
Kyle Spearrin 2020-10-22 12:32:33 -04:00 committed by GitHub
parent f54ca688d4
commit 3629c2c0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -820,12 +820,17 @@
setValueForElement(el);
afterValSetFunc(el);
setValueForElementByEvent(el);
canSeeElementToStyle(el) && (el.className += ' com-bitwarden-browser-animated-fill',
// START MODIFICATION
if (canSeeElementToStyle(el)) {
el.classList.add('com-bitwarden-browser-animated-fill');
setTimeout(function () {
// START MODIFICATION
el && el.className && (el.className = el.className.replace(/(\\s)?com-bitwarden-browser-animated-fill/, ''));
// END MODIFICATION
}, styleTimeout));
if (el) {
el.classList.remove('com-bitwarden-browser-animated-fill');
}
}, styleTimeout);
}
// END MODIFICATION
}
document.elementForOPID = getElementByOpId;