From e71bea9df6e7fe6c19d682badb0fd38e6278ebf0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 19 Feb 2015 18:49:22 +0100 Subject: [PATCH] Cleanup etherpad button --- public/js/vroom.js | 7 +++---- templates/default/join.html.ep | 32 ++++++++++++-------------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index ad59c95..dd1b1bc 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -1996,20 +1996,19 @@ function initVroom(room) { }); if (etherpad.enabled){ - $('#etherpadButton').change(function(){ - var action = ($(this).is(':checked')) ? 'show':'hide'; + $('.btn-etherpad').click(function(){ + var action = ($(this).hasClass('btn-danger')) ? 'hide':'show'; if (action === 'show'){ // If not already loaded, load etherpad in the iFrame if ($('#etherpadContainer').html() == ''){ loadEtherpadIframe(); } - $('#etherpadLabel').addClass('btn-danger'); $('#etherpadContainer').slideDown('200'); } else{ - $('#etherpadLabel').removeClass('btn-danger'); $('#etherpadContainer').slideUp('200'); } + $('.btn-etherpad').toggleClass('btn-danger').button('toggle'); }); } diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 0c45b9e..cf23fc0 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -44,28 +44,20 @@ + <% } %> +