Template:UIUCJavascript

From 2013.igem.org

(Difference between revisions)
Line 3: Line 3:
<script type="text/javascript">
<script type="text/javascript">
-
(function() { // BeginSpryComponent
+
(function() {  
if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
if (typeof Spry == "undefined") window.Spry = {}; if (!Spry.Widget) Spry.Widget = {};
Line 136: Line 136:
Spry.Widget.Accordion.prototype.closePanel = function()
Spry.Widget.Accordion.prototype.closePanel = function()
{
{
-
// The accordion can only ever have one panel open at any
 
-
// give time, so this method only closes the current panel.
 
-
// If the accordion is in fixed panel heights mode, this
 
-
// method does nothing.
 
if (!this.useFixedPanelHeights && this.currentPanel)
if (!this.useFixedPanelHeights && this.currentPanel)
Line 288: Line 284:
this.removeClassName(panel, this.closedClass);
this.removeClassName(panel, this.closedClass);
this.addClassName(panel, this.openClass);
this.addClassName(panel, this.openClass);
-
 
-
// Attempt to set up the height of the default panel. We don't want to
 
-
// do any dynamic panel height calculations here because our accordion
 
-
// or one of its parent containers may be display:none.
 
if (content)
if (content)
Line 297: Line 289:
if (this.useFixedPanelHeights)
if (this.useFixedPanelHeights)
{
{
-
// We are in fixed panel height mode and the user passed in
+
-
// a panel height for us to use.
+
if (this.fixedPanelHeight)
if (this.fixedPanelHeight)
Line 305: Line 296:
else
else
{
{
-
// We are in variable panel height mode, but since we can't
+
-
// calculate the panel height here, we just set the height to
+
-
// auto so that it expands to show all of its content.
+
-
+
content.style.height = "auto";
content.style.height = "auto";
}
}
Line 333: Line 321:
for (var i = 0; i < panels.length; i++)
for (var i = 0; i < panels.length; i++)
this.initPanel(panels[i], i == this.defaultPanel);
this.initPanel(panels[i], i == this.defaultPanel);
-
 
-
// Advanced keyboard navigation requires the tabindex attribute
 
-
// on the top-level element.
 
this.enableKeyboardNavigation = (this.enableKeyboardNavigation && this.element.attributes.getNamedItem("tabindex"));
this.enableKeyboardNavigation = (this.enableKeyboardNavigation && this.element.attributes.getNamedItem("tabindex"));
Line 411: Line 396:
this.element.blur();
this.element.blur();
};
};
-
 
-
/////////////////////////////////////////////////////
 
Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts)
Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts)
Line 534: Line 517:
};
};
-
})(); // EndSpryComponent
+
})();
</script>
</script>
</head>
</head>
</html>
</html>

Revision as of 17:15, 1 September 2013