I have a hidden div in header.tpl that I'm trying to append the topic template into with this code:
require(['translator'], function (translator) {
$.getJSON('/api/topic/8/', function (json) {
templates.parse('topic', json, function (html) {
translator.translate(html, function (translated) {
$(translated).appendTo('.overlay-content');
$('#lb-overlay').css('display','block');
$('html').css('overflow-y','hidden');
});
});
});
});
I basically want to make it so that when you click a link to the topic itself, instead of displaying in the main window, it will open up this overlay div and display the topic info inside the div. The code above was taken from the topic I replied to in my opening post when another user tried to append the recent template into a sidebar. The topic content is displayed properly inside the div, but none of the buttons (reply, favoriting etc.) do not work inside the div. Is there more I need to do in order to render the template properly with full functionality inside the overlay? I can have an iframe inside the div pointing to the topic/url I want but I would rather not use that if there is a way to simply render the template inside a different div.