VRFS-1110 removed autocomplete for session update
This commit is contained in:
parent
c46f8c4476
commit
45f2124cfa
|
|
@ -16,7 +16,7 @@
|
|||
var inviteAction = 'create'; // create/update
|
||||
var friendInput = null;
|
||||
var updateSessionID = null;
|
||||
var addInstructions = null;
|
||||
var addInstructions = '';
|
||||
|
||||
function _initInvite(elemSelector, iAction, instructions) {
|
||||
addInstructions = instructions;
|
||||
|
|
@ -38,7 +38,10 @@
|
|||
this.clearSelections();
|
||||
updateSessionID = sessionId;
|
||||
friendSelectorDialog.setCallback(friendSelectorCallback);
|
||||
|
||||
inviteAction = 'update';
|
||||
friendInput = '#friend-input-'+inviteAction;
|
||||
|
||||
if (0 == $(elemSelector + ' .friendbox').length) {
|
||||
_appendFriendSelector($(elemSelector));
|
||||
$('#btn-save-invites').click(function() {
|
||||
|
|
@ -77,24 +80,18 @@
|
|||
userIds.push(this.id);
|
||||
userPhotoUrls.push(this.photo_url);
|
||||
});
|
||||
|
||||
var autoCompleteOptions = {
|
||||
lookup: { suggestions: userNames, data: userIds },
|
||||
onSelect: addInvitation,
|
||||
serviceUrl: '/api/search.json?srch_sessinv=1',
|
||||
minChars: 3,
|
||||
autoSelectFirst: true
|
||||
};
|
||||
|
||||
$(friendInput).attr("placeholder", "Type a friend\'s name").prop('disabled', false);
|
||||
autoComplete = $(friendInput).autocomplete(autoCompleteOptions);
|
||||
/*if (!autoComplete) {
|
||||
if (friendInput) {
|
||||
var autoCompleteOptions = {
|
||||
lookup: { suggestions: userNames, data: userIds },
|
||||
onSelect: addInvitation,
|
||||
serviceUrl: '/api/search.json?srch_sessinv=1',
|
||||
minChars: 3,
|
||||
autoSelectFirst: true
|
||||
};
|
||||
$(friendInput).attr("placeholder", "Type a friend\'s name").prop('disabled', false)
|
||||
autoComplete = $(friendInput).autocomplete(autoCompleteOptions);
|
||||
} else {
|
||||
autoComplete.setOptions(autoCompleteOptions);
|
||||
}*/
|
||||
|
||||
$(".autocomplete").width("150px");
|
||||
$(".autocomplete").width("150px");
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
$(friendInput).attr("placeholder", "Unable to lookup friends");
|
||||
|
|
@ -201,10 +198,11 @@
|
|||
}
|
||||
|
||||
function _friendSelectorHTML() {
|
||||
var fInput = friendInput ? friendInput.substring(1,friendInput.length) : '';
|
||||
return context.JK.fillTemplate($('#template-session-invite-musicians').html(),
|
||||
{choose_friends_id: 'btn-choose-friends-'+inviteAction,
|
||||
selected_friends_id: 'selected-friends-'+inviteAction,
|
||||
friend_input: friendInput.substring(1,friendInput.length),
|
||||
friend_input: fInput,
|
||||
instructions: addInstructions});
|
||||
}
|
||||
|
||||
|
|
@ -216,10 +214,14 @@
|
|||
invitedFriends.map(function(uid) { obj[uid] = true; });
|
||||
friendSelectorDialog.showDialog(obj);
|
||||
});
|
||||
if ('update' == inviteAction) {
|
||||
$(friendInput).hide();
|
||||
}
|
||||
};
|
||||
|
||||
this.initialize = function(friendSelectorDialogInstance) {
|
||||
friendSelectorDialog = friendSelectorDialogInstance;
|
||||
return this;
|
||||
};
|
||||
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Reference in New Issue