@crazycells @DownPW something of a “fresher” approach. Have a look at the below
Using the messenger type view I created, it then becomes possible to place the “verified” group according to the style from the same view.
This does mean some new CSS
.self-post a[href*="/groups/verified"] .group-label {
position: absolute !important;
right: 51px;
top: 44px;
}
.topic-response-post a[href*="/groups/verified"] .group-label {
position: absolute !important;
left: 20px;
top: 44px;
}
.topic-response-post i[component="user/status"] {
position: absolute;
left: -1px;
}
And, more importantly, I found a more efficient way of adding classes in the messenger view js
. The revised code is below
// Target those elements already loaded in the DOM
$(document).ready(function() {
$(window).on('action:ajaxify.end', function(data) {
$('li[component="post"]').each(function(i, obj) {
if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
console.log("Adding required classes for messenger type view");
$(this).addClass('topic-response-post');
}
});
});
});
// Target elements dynamically added to the DOM on post load
$(document).ready(function() {
$(window).on('action:ajaxify.loaded', function(data) {
$('li[component="post"]').each(function(i, obj) {
if (!$(this).hasClass('self-post') || (!$(this).hasClass('self-post'))) {
console.log("Adding required classes for messenger type view");
$(this).addClass('topic-response-post');
}
});
});
});