voxmedia / autotune

Platform for reusable news tools
BSD 3-Clause "New" or "Revised" License
415 stars 37 forks source link

[question] Layout customization (Autotune is always prepended to body) #395

Closed pardo-bsso closed 7 years ago

pardo-bsso commented 7 years ago

Hello again,

In https://github.com/voxmedia/autotune/blob/master/app/views/layouts/autotune/application.html.erb#L17 we have:

<%=render 'autotune/body_top' %>
<%= yield %>
<%=render 'autotune/body_bottom' %>

However in https://github.com/voxmedia/autotune/blob/master/appjs/app.js#L94

 $('body').prepend(view.$el);

And if we try to add content into body_top that would still move the application above it. Is there any reason to not do something like

<%=render 'autotune/body_top' %>
<div id="autotune-main-body">
  <%= yield %>
</div>
<%=render 'autotune/body_bottom' %>
 $('#autotune-main-body').prepend(view.$el);

Thanks.

ryanmark commented 7 years ago

That sounds totally fine