From 90d4004c73eceb8f7dba3d5a323230250775239c Mon Sep 17 00:00:00 2001 From: Felix Gliesche Date: Mon, 5 Oct 2015 18:01:59 +0200 Subject: [PATCH 1/1] Update showTab to work for multiple tabs on same page --- public/javascripts/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 5ff306e..32261e0 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -315,8 +315,8 @@ function toggleMultiSelect(el) { } function showTab(name, url) { - $('div#content .tab-content').hide(); - $('div.tabs a').removeClass('selected'); + $('#tab-content-' + name).parent().find('.tab-content').hide(); + $('#tab-content-' + name).parent().find('div.tabs a').removeClass('selected'); $('#tab-content-' + name).show(); $('#tab-' + name).addClass('selected'); //replaces current URL with the "href" attribute of the current link -- 1.9.3 (Apple Git-50)