Template:Team:UC Davis/MutantWidget
From 2011.igem.org
(Difference between revisions)
Line 115: | Line 115: | ||
mutantcolors = ["white", "#ff6666", "orange", "yellow", "#66ff66", "#66ffff", "#ddaaff", "pink"]; | mutantcolors = ["white", "#ff6666", "orange", "yellow", "#66ff66", "#66ffff", "#ddaaff", "pink"]; | ||
selectedColor = "orange"; | selectedColor = "orange"; | ||
+ | widget_mode = "2D"; | ||
+ | have_3d_data = false; | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
$("#mutantwidget").append('<div id="mw_selectmenu"/>'); | $("#mutantwidget").append('<div id="mw_selectmenu"/>'); | ||
Line 128: | Line 130: | ||
$('#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>"); | $('#mw_optionstable').append("<tr><td>Sequence</td></tr>"); | ||
- | } | + | have_3d_data = true; |
+ | } else { | ||
+ | have_3d_data = false; | ||
+ | $('#mw_optionstable').append("<tr><td>2D Plot</td><td>Sequence</td></tr>"); | ||
+ | } | ||
$('#mutantwidget').prepend('<div id="mw_grapharea"/>'); | $('#mutantwidget').prepend('<div id="mw_grapharea"/>'); | ||
$('#mw_grapharea').append('<div id="mw_plot"/>'); | $('#mw_grapharea').append('<div id="mw_plot"/>'); | ||
Line 168: | Line 174: | ||
}); | }); | ||
- | $('# | + | $('#mw_optionsmenu td').click( |
function() { | function() { | ||
+ | menuitem = $(this).parent().index(); | ||
+ | if( | ||
+ | } | ||
+ | ); | ||
+ | $('#mw_selectmenu td').click( | ||
+ | function() { | ||
+ | if(widget_mode == "2D") | ||
+ | { | ||
if($(this).hasClass("selected")) | if($(this).hasClass("selected")) | ||
{ | { | ||
Line 207: | Line 221: | ||
}); | }); | ||
} | } | ||
+ | } else if(widget_mode == "3D") | ||
+ | { | ||
+ | alert("clicked!"); | ||
+ | } | ||
); | ); | ||
//Split sequences | //Split sequences | ||
Line 536: | Line 554: | ||
position: absolute; | position: absolute; | ||
margin: 4px; | margin: 4px; | ||
- | |||
width: 80px; | width: 80px; | ||
} | } |
Revision as of 01:16, 25 September 2011