Skip to content

Commit

Permalink
Merge branch 'refs/heads/#54-mentions'
Browse files Browse the repository at this point in the history
  • Loading branch information
dantestopp committed Mar 11, 2016
2 parents adda910 + e34fcbf commit 7204eb3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions client/stylesheets/modules/posts.import.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ textarea {
min-height: 200px;
}
}

[data-id="insert-post-form"] .-autocomplete-container {
margin-top: 15px;
}
2 changes: 1 addition & 1 deletion client/views/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="row">
<div class="twelve columns">
<form data-id="insert-post-form">
<textarea class="u-full-width insert-post-form" rows="1" placeholder="Write something..." data-id="body"></textarea>
{{>textareaAutocomplete settings=settings data-id="body" class="u-full-width insert-post-form" rows="1" placeholder="Write something..." }}
<input type="submit" class="button-primary u-pull-right" value="Submit">
</form>
</div>
Expand Down
20 changes: 20 additions & 0 deletions client/views/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,30 @@ Template.feed.onCreated(function () {

this.autorun(() => {
this.subscribe('posts.all', this.searchQuery.get(), this.filter.get(), this.limit.get());
this.subscribe('users.all', this.searchQuery.get(), this.limit.get());
this.postsCount.set(Counts.get('posts.all'));
});
});

Template.feed.onRendered(() => {
autosize($('[data-id=body]'));
});

Template.feed.helpers({
//Settings for autocomplete in post field
settings: () => {
return {
position: 'bottom',
limit: 5,
rules: [
{
token: '@',
collection: Meteor.users,
field: 'username',
template: Template.userList,
filter: { _id: { $ne: Meteor.userId() }}
}
]
};
}
});

0 comments on commit 7204eb3

Please sign in to comment.