update YUI to 2.8.0r4

This commit is contained in:
Graham Knop 2009-09-21 12:54:44 -05:00
parent 27f474ec64
commit 2d28e0c0ba
2007 changed files with 344487 additions and 210070 deletions

View file

@ -1,6 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Fixed Width Menu Button</title>
@ -22,7 +24,7 @@ body {
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="../../build/container/container_core-min.js"></script>
<script type="text/javascript" src="../../build/menu/menu-min.js"></script>
<script type="text/javascript" src="../../build/element/element-beta-min.js"></script>
<script type="text/javascript" src="../../build/element/element-min.js"></script>
<script type="text/javascript" src="../../build/button/button-min.js"></script>
@ -83,7 +85,7 @@ body {
</head>
<body class=" yui-skin-sam">
<body class="yui-skin-sam">
<h1>Fixed Width Menu Button</h1>
@ -101,35 +103,10 @@ when updated to represent the selected menu item.
<script type="text/javascript">
YAHOO.example.init = function () {
// Click event handler for the Button instance
function onMenuClick(p_sType, p_aArgs) {
// The MenuItem instance that was clicked
var oMenuItem = p_aArgs[1];
if (oMenuItem) {
/*
Set the Button's "label" attribute to the value of the
"text" configuration property of the MenuItem that was
the target of the "click" event.
*/
oButton.set("label", ("<em>" + oMenuItem.cfg.getProperty("text") + "</em>"));
}
}
/*
Create an array of name and value pairs that serve as the data
source for the Button instance's menu.
*/
YAHOO.util.Event.onAvailable("buttoncontainer", function () {
// Create an array of name and value pairs that serve as the data
// source for the Button instance's menu.
var aCategories = [
@ -141,10 +118,8 @@ when updated to represent the selected menu item.
];
/*
Create a Button instance, wrapping the text label in an <EM>
tag that will be given a fixed width of 10em.
*/
// Create a Button instance, wrapping the text label in an <EM>
// tag that will be given a fixed width of 10em.
var oButton = new YAHOO.widget.Button({
type: "menu",
@ -153,19 +128,28 @@ when updated to represent the selected menu item.
menu: aCategories,
container: "buttoncontainer" });
/*
Subscribe to the Menu instance's "click" event once the Button
instance is appended to its specified container.s
*/
oButton.on("appendTo", function () {
oButton.getMenu().subscribe("click", onMenuClick);
// "selectedMenuItemChange" event handler for a Button that will set
// the Button's "label" attribute to the value of the "text"
// configuration property of the MenuItem that was clicked.
var onSelectedMenuItemChange = function (event) {
var oMenuItem = event.newValue;
this.set("label", ("<em class=\"yui-button-label\">" +
oMenuItem.cfg.getProperty("text") + "</em>"));
};
// Register a "selectedMenuItemChange" event handler that will sync the
// Button's "label" attribute to the MenuItem that was clicked.
oButton.on("selectedMenuItemChange", onSelectedMenuItemChange);
});
});
} ();
</script>
<div id="buttoncontainer"></div>