Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #345 from tms/fatten-up-static-pages

Don't double-up on #main-outlet when static content is preloaded
  • Loading branch information...
commit 3287dcf7540e92db3e98289d1cb913f11909ebe2 2 parents 3588734 + f46c819
@eviltrout eviltrout authored
View
3  app/assets/javascripts/discourse/controllers/static_controller.js
@@ -18,7 +18,8 @@ Discourse.StaticController = Discourse.Controller.extend({
$preloaded = $("noscript[data-path=\"" + path + "\"]");
if ($preloaded.length) {
text = $preloaded.text();
- text = text.replace(/<header[\s\S]*<\/header\>/, '');
+ text = text.match(/<!-- preload-content: -->((?:.|[\n\r])*)<!-- :preload-content -->/);
+ text = text[1];
return this.set('content', text);
} else {
return jQuery.ajax({
View
2  app/views/layouts/application.html.erb
@@ -40,7 +40,9 @@
</div>
</header>
<div id="main-outlet" class="container">
+ <!-- preload-content: -->
<%= yield %>
+ <!-- :preload-content -->
</div>
</noscript>
</section>
Please sign in to comment.
Something went wrong with that request. Please try again.