Correctly update switches when updating config

master
Daniel Berteaud 10 years ago
parent 58219f62d9
commit d9eeca2c90
  1. 17
      public/js/vroom.js

@ -508,18 +508,11 @@ function initVroom(room) {
$('.unauthEl').hide(500); $('.unauthEl').hide(500);
} }
} }
if (data.locked == 'yes'){ // Update config switches
$('#lockedSet').bootstrapSwitch('state', true); $('#lockedSet').bootstrapSwitch('state', data.locked == 'yes');
} $('#askForNameSet').bootstrapSwitch('state', data.ask_for_name == 'yes');
if (data.ask_for_name == 'yes'){ $('#joinPassSet').bootstrapSwitch('state', data.join_auth == 'yes');
$('#askForNameSet').bootstrapSwitch('state', true); $('#ownerPassSet').bootstrapSwitch('state', data.owner_auth == 'yes');
}
if (data.join_auth == 'yes'){
$('#joinPassSet').bootstrapSwitch('state', true);
}
if (data.owner_auth == 'yes'){
$('#ownerPassSet').bootstrapSwitch('state', true);
}
} }
}); });
} }

Loading…
Cancel
Save