Cleanup MOH button

master
Daniel Berteaud 10 years ago
parent e71bea9df6
commit c1c9810381
  1. 15
      public/js/vroom.js
  2. 7
      templates/default/join.html.ep

@ -1111,12 +1111,12 @@ function initVroom(room) {
function checkMoh(){
setTimeout(function(){
if (countPeers() < 1){
if ($('#pauseMohButton').is(':checked')){
if ($('.btn-moh:first').hasClass('btn-danger')){
$('#mohPlayer').get(0).volume = .25;
$('#mohPlayer').get(0).play();
}
else{
$('#pauseMohButton').notify(locale.WAIT_WITH_MUSIC, 'info');
$('.btn-moh>span:first').notify(locale.WAIT_WITH_MUSIC, 'info');
}
$('.aloneEl').show(200);
}
@ -1840,15 +1840,14 @@ function initVroom(room) {
});
// Suspend/Play MoH
$('#pauseMohButton').change(function(){
if ($(this).is(":checked")){
$('#mohPlayer')[0].play();
$('#pauseMohLabel').addClass('btn-danger');
$('.btn-moh').click(function(){
if ($(this).hasClass('btn-danger')){
$('#mohPlayer')[0].pause();
}
else{
$('#mohPlayer')[0].pause();
$('#pauseMohLabel').removeClass('btn-danger');
$('#mohPlayer')[0].play();
}
$('.btn-moh').toggleClass('btn-danger').button('toggle');
});
// Handle hangup/close window

@ -72,12 +72,11 @@
</span>
</button>
</div>
<div class="btn-group navbar-form navbar-btn-group navbar-left hidden-xs aloneEl" data-toggle="buttons">
<label class="btn btn-default help" id="pauseMohLabel" data-toggle="tooltip" data-placement="bottom" title="<%=l 'PAUSE_MOH' %>">
<input type="checkbox" id="pauseMohButton">
<div class="btn-group navbar-form navbar-btn-group navbar-left hidden-xs aloneEl">
<button class="btn btn-default help btn-moh" data-toggle="tooltip" data-placement="bottom" title="<%=l 'PAUSE_MOH' %>">
<span class="glyphicon glyphicon-music">
</span>
</label>
</button>
</div>
<div class="btn-group navbar-form navbar-btn-group navbar-left">
<div class="btn-group ownerEl">

Loading…
Cancel
Save