Template:Team:UC Davis/MutantWidget

From 2011.igem.org

(Difference between revisions)
Line 125: Line 125:
$('#mutantwidget h3').wrapInner('<td/>').children().unwrap().css({opacity:.3}).wrap('<tr/>');
$('#mutantwidget h3').wrapInner('<td/>').children().unwrap().css({opacity:.3}).wrap('<tr/>');
$('#mutantwidget tr').appendTo($('#mutantwidget #seltable'));
$('#mutantwidget tr').appendTo($('#mutantwidget #seltable'));
 +
 +
        $('#mw_optionstable').append("<tr><td onClick>2D Plot</td></tr>");
         if($("#mutantwidget .zdata_3d").length > 0)
         if($("#mutantwidget .zdata_3d").length > 0)
         {
         {
-
            $('#mw_optionstable').append("<tr><td>2D Plot</td></tr>");
 
             $('#mw_optionstable').append("<tr><td>3D Plot</td></tr>");
             $('#mw_optionstable').append("<tr><td>3D Plot</td></tr>");
-
            $('#mw_optionstable').append("<tr><td>Sequence</td></tr>");
 
have_3d_data = true;
have_3d_data = true;
-
         } else {
+
         }
-
have_3d_data = false;
+
        $('#mw_optionstable').append("<tr><td>Sequence</td></tr>");
-
$('#mw_optionstable').append("<tr><td>2D Plot</td><td>Sequence</td></tr>");
+
 
-
}
+
$('#mw_optionstable td').css({opacity:0.3});
$('#mw_optionstable td').css({opacity:0.3});
$('#mutantwidget').prepend('<div id="mw_grapharea"/>');
$('#mutantwidget').prepend('<div id="mw_grapharea"/>');
Line 178: Line 177:
function() {
function() {
menuitem = $(this).parent().index();
menuitem = $(this).parent().index();
-
if(have_3d_data)
+
if(!$(this).hasClass("selected"))
{
{
 +
$('#mw_optionsmenu td').removeClass("selected")'
 +
$(this).addClass("selected");
 +
$('#mw_optionsmenu td').mouseout();
 +
if($(this).text() == "2D Plot")
 +
{
 +
$('#mw_3dplot').hide();
 +
$('#mw_plot').show();
 +
}
 +
if($(this).text() == "3D Plot")
 +
{
 +
$('#mw_plot').hide();
 +
$('#mw_3dplot').show();
 +
}
}
}
 +
}
}
);
);

Revision as of 01:53, 25 September 2011