codersgrave/Facebook-Friend-Selector — pull request #7 by ikarius6 (2013-11-16 16:24:37+00:00)
Title: Adding onPreStart

This is to get a predefined config, when you select some ppl and save the dialog and then you open the dialog again the getStoredFriends is cleaned.... for some applications is usefull restore the friends selected and stored in an input, Example:

$(".who_share").fSelector({
getStoredFriends: [],
closeOnSubmit: true,
facebookInvite: false,
onSubmit: function(response){
$('#priv_sel').removeClass().addClass('icon-group');
$('#priv_opcs>li').show();
$('input[name=privacidad]').val(3);
alertify.log('Publicación Personalizada');
$('input[name=amigos]').val(response);
},
onPreStart: function(response){
facebook_friends = $('input[name=amigos]').val().split(",")
for(var i=0; i