removed autocomplete, fixed bugs with dropdown

This commit is contained in:
Sacha Greif 2014-07-03 10:28:27 +09:00
parent 57487e5abf
commit b6e26f634e
7 changed files with 6 additions and 52 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -56,9 +56,5 @@ Deps.autorun(function() {
// userId() can be changed before user(), because loading profile takes time
if(Meteor.userId()) {
Meteor.subscribe('notifications');
if(isAdmin(Meteor.user())){
// Subscribe to all users for now to make user selection autocomplete work
Meteor.subscribe('allUsersAdmin');
}
}
});

View file

@ -41,7 +41,7 @@
<div class="controls">
<select id="postUser">
{{#each users}}
<option {{isSelected}} value="{{_id}}">{{userName}}</option>
<option {{isSelected this}} value="{{_id}}">{{userName}}</option>
{{/each}}
</select>
</div>

View file

@ -11,9 +11,8 @@ Template.post_submit.helpers({
userName: function(){
return getDisplayName(this);
},
isSelected: function(){
var post=Posts.findOne(Session.get('selectedPostId'));
return (post && this._id == post.userId) ? 'selected' : '';
isSelected: function(user){
return user._id == Meteor.userId() ? "selected" : "";
}
});

View file

@ -94,6 +94,7 @@ RSS
preloadSubscriptions.push('settings');
preloadSubscriptions.push('currentUser');
preloadSubscriptions.push('allUsersAdmin');
Router.configure({
layoutTemplate: 'layout',

View file

@ -93,8 +93,9 @@ Meteor.publish('allUsers', function(filterBy, sortBy, limit) {
// TODO: find a better way
Meteor.publish('allUsersAdmin', function() {
var selector = getSetting('requirePostInvite') ? {isInvited: true} : {};
if (isAdminById(this.userId)) {
return Meteor.users.find({isInvited: true});
return Meteor.users.find(selector);
} else {
return [];
}