Blog Post
AbhishekGu
2 years agoKhoros Staff
Hello tyw ,
Sorry to hear that!! Ideally, that should not be a case as truncating the notification is a core functionality, but still somehow that is not working for you. Kindly add below code to the bottom of the same component:
<@liaAddScript>
;(function ($) {
var length = 10; // Whatever length you want to truncate the notification
var length = length-3; // 3 dots will also be part of total truncated string length
const notificationFeed = document.getElementsByClassName("lia-notification-feed-item")[0];
const description = notificationFeed.getElementsByClassName("description")[0];
var pathname = description.getElementsByClassName("lia-link-navigation")[0].innerHTML;
var trimmedPathname = pathname.substring(0, Math.min(length,pathname.length));
description.getElementsByClassName("lia-link-navigation")[0].innerHTML = trimmedPathname + "...";
})(LITHIUM.jQuery);
</@liaAddScript>
Let me know if you need any further help on this.
Regards,
Abhishek Gupta