2022-09-21 15:58:22 +03:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import {action} from '@ember/object';
|
2022-11-28 16:43:35 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2022-09-21 15:58:22 +03:00
|
|
|
|
|
|
|
export default class ActivityFeed extends Component {
|
2022-11-28 16:43:35 +03:00
|
|
|
@service feature;
|
|
|
|
|
2022-09-21 15:58:22 +03:00
|
|
|
linkScrollerTimeout = null; // needs to be global so can be cleared when needed across functions
|
2022-11-28 16:43:35 +03:00
|
|
|
excludedEventTypes = this.feature.get('suppressionList')
|
|
|
|
? ['aggregated_click_event']
|
|
|
|
: ['email_sent_event', 'aggregated_click_event'];
|
2022-09-21 15:58:22 +03:00
|
|
|
|
|
|
|
@action
|
|
|
|
enterLinkURL(event) {
|
|
|
|
event.stopPropagation();
|
|
|
|
const parent = event.target;
|
|
|
|
const child = event.target.querySelector('span');
|
|
|
|
|
|
|
|
clearTimeout(this.linkScrollerTimeout);
|
|
|
|
if (child.offsetWidth > parent.offsetWidth) {
|
|
|
|
this.linkScrollerTimeout = setTimeout(() => {
|
|
|
|
parent.classList.add('scroller');
|
|
|
|
child.style.transform = `translateX(-${(child.offsetWidth - parent.offsetWidth) + 8}px)`;
|
|
|
|
}, 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
leaveLinkURL(event) {
|
|
|
|
event.stopPropagation();
|
|
|
|
clearTimeout(this.linkScrollerTimeout);
|
|
|
|
const parent = event.target;
|
|
|
|
const child = event.target.querySelector('span');
|
|
|
|
|
|
|
|
child.style.transform = 'translateX(0)';
|
|
|
|
parent.classList.remove('scroller');
|
|
|
|
}
|
2022-10-24 12:11:44 +03:00
|
|
|
}
|