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

Don't double-up on #main-outlet when static content is preloaded
This commit is contained in:
Robin Ward 2013-03-04 06:45:55 -08:00
commit 3287dcf754
2 changed files with 4 additions and 1 deletions

View File

@ -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 File

@ -40,7 +40,9 @@
</div>
</header>
<div id="main-outlet" class="container">
<!-- preload-content: -->
<%= yield %>
<!-- :preload-content -->
</div>
</noscript>
</section>