We have implemented a layout where the main content is in the dynamic sidebars. We defined the following layoutTemplate :
<template name="layout"> {{> content}} {{> leftbar}} {{> rightbar}} <nav class="navigation"> {{#if currentUser}} {{> navigation_logged_in}} {{else}} {{> navigation_logged_out}} {{/if}} </nav> </template>
We include, for example, the template of the right template in the layout template.
<template name="rightbar"> <aside class="rightbar"> <button id="closeRightBar" class="close-cross"></button> {{yield 'rightbar'}} </aside> </template>
The right-bar template includes the value of the rightbar, where we provide specific content.
We have implemented the following RouteController:
UserShowRouter = RouteController.extend({ before: function() { var username = this.params.username; if(App.subs.user) { App.subs.user.stop(); } App.subs.user = Meteor.subscribe('user', username); }, waitOn: function () { return Meteor.subscribe('user'); }, data: function() { return Meteor.users.findOne({'profile.username': this.params.username}); }, action: function() { this.render('profile', {to: 'rightbar'}); } });
What we wanted to achieve is that, for example, the profile template is entered in the rightbar income and is updated and re-displayed when the data changes.
The problem is that the sidebars are dynamically animated, shown, and hidden. Now every time the profile template gets re-rendered , the layout template gets re-rendered . Why is this? We thought that one of the goals of profitability regions is that the entire site does not need to be reprocessed. Now that the layout gets re-rendered, all css animations are back to their original values.
Now we have tried several different approaches, but none of them seems to be a good and clean solution. Is there a way to keep the layout template from being re-rendered and just keep the yield area and the template date? Any suggestions or alternatives would be highly appreciated.