js function refactoring
This commit is contained in:
8
public/akaunting-js/generalAction.js
vendored
8
public/akaunting-js/generalAction.js
vendored
@ -360,16 +360,14 @@ if (navigator.userAgent.search("Firefox") >= 0) {
|
||||
|
||||
//margue animation for truncated text
|
||||
document.querySelectorAll('[data-truncate]').forEach((truncate) => {
|
||||
let truncateText = truncate.innerText.split(" ").join("");
|
||||
|
||||
if (truncate.offsetWidth > truncate.parentElement.clientWidth || truncate.offsetWidth > truncate.parentElement.parentElement.clientWidth) {
|
||||
truncate.addEventListener('mouseover', function () {
|
||||
truncate.parentElement.style.animationPlayState = 'running';
|
||||
truncate.parentElement.classList.add('animate-marquee');
|
||||
|
||||
// if (truncate.parentElement.classList.contains('truncate')) {
|
||||
// truncate.parentElement.classList.remove('truncate');
|
||||
// }
|
||||
if (truncate.parentElement.classList.contains('truncate')) {
|
||||
truncate.parentElement.classList.remove('truncate');
|
||||
}
|
||||
});
|
||||
|
||||
truncate.addEventListener('mouseout', function () {
|
||||
|
Reference in New Issue
Block a user