From e52277bdad6d45420284109819f6b6b09934dd41 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Wed, 21 Dec 2016 13:15:55 +0100 Subject: [PATCH] Fix sample types & groups when editing sample in samples table Closes SCI-811. --- app/assets/javascripts/sitewide/utils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/sitewide/utils.js b/app/assets/javascripts/sitewide/utils.js index 50224bb57..ed6fd8aa1 100644 --- a/app/assets/javascripts/sitewide/utils.js +++ b/app/assets/javascripts/sitewide/utils.js @@ -239,8 +239,10 @@ $.fn.makeDropdownOptionsLinks = function(selectedIdx, urlParam) { } else { $(this).attr('href', '#'); } - }) - .eq(selectedIdx).attr('selected', true); + }); + $(this) + .find('option[value=' + selectedIdx + ']') + .attr('selected', true); return this; };