Menu: Rename nested.html to flyoutmenu.html, updated headers

This commit is contained in:
jzaefferer 2011-02-22 16:15:11 +01:00
parent f8091f761c
commit faa4b970a7
4 changed files with 8 additions and 14 deletions

View File

@ -46,7 +46,8 @@
<a href="menu/menu.html">Menu</a> <a href="menu/menu.html">Menu</a>
<ul> <ul>
<li><a href="menu/contextmenu.html">Context Menu</a></li> <li><a href="menu/contextmenu.html">Context Menu</a></li>
<li><a href="menu/nested.html">Nested Menu</a></li> <li><a href="menu/flyoutmenu.html">Flyout Menu</a></li>
<li><a href="menu/menubar.html">Menubar</a></li>
<li><a href="menu/drilldown.html">Drilldown Menu</a></li> <li><a href="menu/drilldown.html">Drilldown Menu</a></li>
</ul> </ul>
</li> </li>

View File

@ -1,12 +1,7 @@
/* /*
* jQuery UI flyout menu * jQuery UI flyoutmenu
* - written for jQuery UI 1.9 milestone 2 using the widget factory
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* modified from: http://view.jqueryui.com/menu/tests/visual/menu/nested.html
* by: Michael Lang, http://nexul.com/
* *
* backported from Michael Lang's fork: http://www.nexul.com/prototypes/toolbar/demo.html
*/ */
(function($) { (function($) {
@ -64,11 +59,13 @@ $.widget("ui.flyoutmenu", {
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
} }
var match = self.activeItem.parent("ul").children("li").filter(function() { var match = self.activeItem.parent("ul").children("li").filter(function() {
// TODO why filter child anchor here, but not in the filter below?
return new RegExp("^" + escape(character), "i").test($("a", this).text()); return new RegExp("^" + escape(character), "i").test($("a", this).text());
}); });
var match = skip && match.index(self.active.next()) != -1 ? match.next() : match; var match = skip && match.index(self.active.next()) != -1 ? match.next() : match;
if (!match.length) { if (!match.length) {
character = String.fromCharCode(event.keyCode); character = String.fromCharCode(event.keyCode);
// TODO why use self.widget() here instead of self.activeItem??
match = self.widget().children("li").filter(function() { match = self.widget().children("li").filter(function() {
return new RegExp("^" + escape(character), "i").test($(this).text()); return new RegExp("^" + escape(character), "i").test($(this).text());
}); });

View File

@ -1,11 +1,7 @@
/* /*
* jQuery UI flyout menu * jQuery UI menubar
* - written for jQuery UI 1.9 milestone 2 using the widget factory
*
* Copyright (c) 2010 Michael Lang, http://nexul.com/
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
* *
* backported from Michael Lang's fork: http://www.nexul.com/prototypes/toolbar/demo.html
*/ */
(function($) { (function($) {