mirror of
https://github.com/vale981/Vulcan
synced 2025-03-12 05:26:38 -04:00
removed autocomplete, fixed bugs with dropdown
This commit is contained in:
parent
57487e5abf
commit
b6e26f634e
7 changed files with 6 additions and 52 deletions
17
client/js/jquery-ui-autocomplete.js
vendored
17
client/js/jquery-ui-autocomplete.js
vendored
File diff suppressed because one or more lines are too long
26
client/js/jquery.select-to-autocomplete.min.js
vendored
26
client/js/jquery.select-to-autocomplete.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -56,9 +56,5 @@ Deps.autorun(function() {
|
||||||
// userId() can be changed before user(), because loading profile takes time
|
// userId() can be changed before user(), because loading profile takes time
|
||||||
if(Meteor.userId()) {
|
if(Meteor.userId()) {
|
||||||
Meteor.subscribe('notifications');
|
Meteor.subscribe('notifications');
|
||||||
if(isAdmin(Meteor.user())){
|
|
||||||
// Subscribe to all users for now to make user selection autocomplete work
|
|
||||||
Meteor.subscribe('allUsersAdmin');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -41,7 +41,7 @@
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select id="postUser">
|
<select id="postUser">
|
||||||
{{#each users}}
|
{{#each users}}
|
||||||
<option {{isSelected}} value="{{_id}}">{{userName}}</option>
|
<option {{isSelected this}} value="{{_id}}">{{userName}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,9 +11,8 @@ Template.post_submit.helpers({
|
||||||
userName: function(){
|
userName: function(){
|
||||||
return getDisplayName(this);
|
return getDisplayName(this);
|
||||||
},
|
},
|
||||||
isSelected: function(){
|
isSelected: function(user){
|
||||||
var post=Posts.findOne(Session.get('selectedPostId'));
|
return user._id == Meteor.userId() ? "selected" : "";
|
||||||
return (post && this._id == post.userId) ? 'selected' : '';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ RSS
|
||||||
|
|
||||||
preloadSubscriptions.push('settings');
|
preloadSubscriptions.push('settings');
|
||||||
preloadSubscriptions.push('currentUser');
|
preloadSubscriptions.push('currentUser');
|
||||||
|
preloadSubscriptions.push('allUsersAdmin');
|
||||||
|
|
||||||
Router.configure({
|
Router.configure({
|
||||||
layoutTemplate: 'layout',
|
layoutTemplate: 'layout',
|
||||||
|
|
|
@ -93,8 +93,9 @@ Meteor.publish('allUsers', function(filterBy, sortBy, limit) {
|
||||||
// TODO: find a better way
|
// TODO: find a better way
|
||||||
|
|
||||||
Meteor.publish('allUsersAdmin', function() {
|
Meteor.publish('allUsersAdmin', function() {
|
||||||
|
var selector = getSetting('requirePostInvite') ? {isInvited: true} : {};
|
||||||
if (isAdminById(this.userId)) {
|
if (isAdminById(this.userId)) {
|
||||||
return Meteor.users.find({isInvited: true});
|
return Meteor.users.find(selector);
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue