diff options
Diffstat (limited to 'demos/autocomplete/categories.html')
-rw-r--r-- | demos/autocomplete/categories.html | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index d986fdb11..d2a107b53 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -4,12 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Categories</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-category { @@ -19,31 +13,29 @@ line-height: 1.5; } </style> - <script> - $.widget( "custom.catcomplete", $.ui.autocomplete, { - _create: function() { - this._super(); - this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); - }, - _renderMenu: function( ul, items ) { - var that = this, - currentCategory = ""; - $.each( items, function( index, item ) { - var li; - if ( item.category != currentCategory ) { - ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); - currentCategory = item.category; - } - li = that._renderItemData( ul, item ); - if ( item.category ) { - li.attr( "aria-label", item.category + " : " + item.label ); - } - }); - } - }); - </script> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> + $.widget( "custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); + }, + _renderMenu: function( ul, items ) { + var that = this, + currentCategory = ""; + $.each( items, function( index, item ) { + var li; + if ( item.category != currentCategory ) { + ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); + currentCategory = item.category; + } + li = that._renderItemData( ul, item ); + if ( item.category ) { + li.attr( "aria-label", item.category + " : " + item.label ); + } + }); + } + }); var data = [ { label: "anders", category: "" }, { label: "andreas", category: "" }, @@ -60,7 +52,6 @@ delay: 0, source: data }); - }); </script> </head> <body> |