From d5170f6181ce2a55ad936b5477fe4eae2a58b437 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Thu, 19 Sep 2019 19:02:08 +0200
Subject: [PATCH] Update spec selection js

---
 .../scipost/update-personal-data-expertises.js   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/scipost/static/scipost/update-personal-data-expertises.js b/scipost/static/scipost/update-personal-data-expertises.js
index b2583214e..d772bea3b 100644
--- a/scipost/static/scipost/update-personal-data-expertises.js
+++ b/scipost/static/scipost/update-personal-data-expertises.js
@@ -5,16 +5,24 @@ $(document).ready(function(){
 
         switch(selection){
         case "physics":
-            $("#id_expertises_0").closest("li").show();
+	    $('li:contains("Physics")').filter(function(){
+		return $(this).text().indexOf('Physics') == 0;}).show();
             break;
         case "astrophysics":
-            $("#id_expertises_1").closest("li").show();
+	    $('li:contains("Astrophysics")').filter(function(){
+		return $(this).text().indexOf('Astrophysics') == 0;}).show();
             break;
         case "mathematics":
-            $("#id_expertises_2").closest("li").show();
+	    $('li:contains("Mathematics")').filter(function(){
+		return $(this).text().indexOf('Mathematics') == 0;}).show();
+            break;
+        case "chemistry":
+	    $('li:contains("Chemistry")').filter(function(){
+		return $(this).text().indexOf('Chemistry') == 0;}).show();
             break;
         case "computerscience":
-            $("#id_expertises_3").closest("li").show();
+	    $('li:contains("Computer Science")').filter(function(){
+		return $(this).text().indexOf('Computer Science') == 0;}).show();
             break;
         default:
             $("ul[id^='id_expertises_']").closest("li").show();
-- 
GitLab