mirror of
https://github.com/dani/vroom.git
synced 2024-06-30 15:23:41 +02:00
Update email list in the new config menu
This commit is contained in:
parent
3436c1320e
commit
b0f77440d9
|
@ -546,9 +546,12 @@ function initVroom(room) {
|
||||||
if (countPeers() > 1){
|
if (countPeers() > 1){
|
||||||
$('.threePeersEl').show(500);
|
$('.threePeersEl').show(500);
|
||||||
}
|
}
|
||||||
|
$('.email-list').find('.email-entry:not(:first)').remove();
|
||||||
$.each(data.notif, function(index, obj){
|
$.each(data.notif, function(index, obj){
|
||||||
addNotifiedEmail(obj.email);
|
addNotifiedEmail(obj.email);
|
||||||
|
addEmailInputField(obj.email);
|
||||||
});
|
});
|
||||||
|
$('.email-list').find('.email-entry:first').remove();
|
||||||
}
|
}
|
||||||
// We're are not owner of the room
|
// We're are not owner of the room
|
||||||
else{
|
else{
|
||||||
|
@ -2028,18 +2031,20 @@ function initVroom(room) {
|
||||||
$('#ownerPassFields').hide(200);
|
$('#ownerPassFields').hide(200);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Add emails input fields
|
function addEmailInputField(val){
|
||||||
$(document).on('click','button.btn-add-email',function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
var parentEl = $('.email-list'),
|
var parentEl = $('.email-list'),
|
||||||
currentEntry = $(this).parents('.email-entry:first'),
|
currentEntry = parentEl.find('.email-entry:last'),
|
||||||
newEntry = $(currentEntry.clone()).appendTo(parentEl);
|
newEntry = $(currentEntry.clone()).appendTo(parentEl);
|
||||||
// Clear the value of the new input field
|
newEntry.find('input').val(val);
|
||||||
newEntry.find('input').val('');
|
|
||||||
parentEl.find('.email-entry:not(:last) .btn-add-email')
|
parentEl.find('.email-entry:not(:last) .btn-add-email')
|
||||||
.removeClass('btn-primary').removeClass('btn-add-email')
|
.removeClass('btn-primary').removeClass('btn-add-email')
|
||||||
.addClass('btn-danger').addClass('btn-remove-email')
|
.addClass('btn-danger').addClass('btn-remove-email')
|
||||||
.html('<span class="glyphicon glyphicon-minus"></span>');
|
.html('<span class="glyphicon glyphicon-minus"></span>');
|
||||||
|
}
|
||||||
|
// Add emails input fields
|
||||||
|
$(document).on('click','button.btn-add-email',function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
addEmailInputField('');
|
||||||
});
|
});
|
||||||
$(document).on('click','button.btn-remove-email',function(e){
|
$(document).on('click','button.btn-remove-email',function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user