mirror of https://github.com/dani/vroom.git
Better auth dialog behavior
This commit is contained in:
parent
4a4b1dbf2e
commit
ef7b3967b2
|
@ -2022,12 +2022,12 @@ function initVroom(room) {
|
|||
});
|
||||
|
||||
// Handle auth to become room owner
|
||||
$('#authPass').on('input', function() {
|
||||
if ($('#authPass').val() === ''){
|
||||
$('#authPassButton').addClass('disabled');
|
||||
$('#ownerAuthPass').on('input', function() {
|
||||
if ($('#ownerAuthPass').val() === ''){
|
||||
$('#ownerAuthButton').attr('disabled', 'disabled');
|
||||
}
|
||||
else{
|
||||
$('#authPassButton').removeClass('disabled');
|
||||
$('#ownerAuthButton').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
$('#ownerAuthForm').submit(function(event) {
|
||||
|
@ -2040,15 +2040,16 @@ function initVroom(room) {
|
|||
room: roomName
|
||||
},
|
||||
function(data){
|
||||
$('#authPass').val('');
|
||||
$('#ownerAuthModal').modal('hide');
|
||||
$('#ownerAuthPass').val('');
|
||||
if (data.role === 'owner'){
|
||||
getPeerRole(peers.local.id);
|
||||
$('#joinPassFields,#ownerPassFields').hide();
|
||||
$('#ownerAuthModal').modal('hide');
|
||||
$.notify(data.msg, 'success');
|
||||
}
|
||||
else{
|
||||
$.notify(localize('WRONG_PASSWORD'), 'error');
|
||||
$('#ownerAuthButton').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
<div class="form-group">
|
||||
<div class="col-sm-offset-4 col-sm-8">
|
||||
<button type="submit"
|
||||
class="btn btn-default btn-primary">
|
||||
id="ownerAuthButton"
|
||||
class="btn btn-default btn-primary"
|
||||
disabled>
|
||||
%= l('SUBMIT')
|
||||
</button>
|
||||
<button class="btn btn-default"
|
||||
|
|
Loading…
Reference in New Issue