From a0b43626089fd32808cb6309a7b324e033f5a18d Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 22 Jan 2015 18:33:46 +0100 Subject: [PATCH] Hide overlays on XS screens Also force hide tooltip when opening a modal dialog to prevent the tooltip being displayed over the modal --- public/js/vroom.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 2d4085e..dcac84d 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -9,6 +9,9 @@ Daniel Berteaud $.notify.defaults( { globalPosition: 'bottom left' } ); // Enable tooltip on required elements $('.help').tooltip({container: 'body'}); +$('.modal').on('show.bs.modal', function(){ + $('.help').tooltip('hide'); +}); // Enable bootstrap-swicth $('.bs-switch').bootstrapSwitch(); @@ -537,7 +540,7 @@ function initVroom(room) { peers[id].role = data.role; if (data.role == 'owner'){ // If this peer is a owner, we add the mark on its preview - $('#overlay_' + id).append($('
').attr('id', 'owner_' + id).addClass('owner')); + $('#overlay_' + id).append($('
').attr('id', 'owner_' + id).addClass('owner hidden-xs')); // And we disable owner's action for him $('#ownerActions_' + id).remove(); } @@ -643,10 +646,10 @@ function initVroom(room) { // the owner actions (overlay) $('
').addClass('volumeBar').attr('id', 'volume_' + id).appendTo(div); $('
').addClass('displayName').attr('id', 'name_' + id).appendTo(div); - $('
').attr('id', 'overlay_' + id).appendTo(div); + $('
').attr('id', 'overlay_' + id).addClass('hidden-xs').appendTo(div); // Will contains per peer action menu (mute/pause/kick), but will only be displayed // on owners screen - $('
').addClass('ownerActions').attr('id', 'ownerActions_' + id).appendTo(div) + $('
').addClass('ownerActions hidden-xs').attr('id', 'ownerActions_' + id).appendTo(div) .append($('
',{ class: 'btn-group' })