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

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

Loading…
Cancel
Save