mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Specify itemView
on the each
helper rather than nesting a view
helper.
This avoids the creation of two views per row, which will make a big difference for large blogs.
This commit is contained in:
parent
106ee21cbf
commit
c52a9e83ea
2 changed files with 17 additions and 19 deletions
|
@ -8,24 +8,22 @@
|
|||
</header>
|
||||
<section class="content-list-content">
|
||||
<ol class="posts-list">
|
||||
{{#each itemController="posts/post"}}
|
||||
{{#view "post-item-view" tagName="li" post=this}} <!-- needed because of "active" class on li item -->
|
||||
{{#link-to 'posts.post' this class="permalink" title="Edit this post"}}
|
||||
<h3 class="entry-title">{{title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="status">
|
||||
{{#if isDraft}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
{{#if isPublished}}
|
||||
<time datetime="{{unbound published_at}}" class="date published">
|
||||
Published {{format-timeago published_at}}
|
||||
</time>
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
||||
{{/view}}
|
||||
{{#each itemController="posts/post" itemView="post-item-view" itemTagName="li"}}
|
||||
{{#link-to 'posts.post' this class="permalink" title="Edit this post"}}
|
||||
<h3 class="entry-title">{{title}}</h3>
|
||||
<section class="entry-meta">
|
||||
<span class="status">
|
||||
{{#if isDraft}}
|
||||
<span class="draft">Draft</span>
|
||||
{{/if}}
|
||||
{{#if isPublished}}
|
||||
<time datetime="{{unbound published_at}}" class="date published">
|
||||
Published {{format-timeago published_at}}
|
||||
</time>
|
||||
{{/if}}
|
||||
</span>
|
||||
</section>
|
||||
{{/link-to}}
|
||||
{{/each}}
|
||||
</ol>
|
||||
</section>
|
||||
|
|
|
@ -2,7 +2,7 @@ import itemView from 'ghost/views/item-view';
|
|||
|
||||
var PostItemView = itemView.extend({
|
||||
openEditor: function () {
|
||||
this.get('controller').send('openEditor', this.get('post')); // send action to handle transition to editor route
|
||||
this.get('controller').send('openEditor', this.get('context')); // send action to handle transition to editor route
|
||||
}.on("doubleClick")
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue