]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: Add UMD wrapper
authorTJ VanToll <tj.vantoll@gmail.com>
Fri, 21 Feb 2014 19:56:13 +0000 (14:56 -0500)
committerTJ VanToll <tj.vantoll@gmail.com>
Fri, 21 Feb 2014 19:56:13 +0000 (14:56 -0500)
ui/selectmenu.js

index 66398a6e3b99af7af8eee94db1fab528eb627b53..2a89d9dd056e1e13d71dd0a554786774ecfa343e 100644 (file)
@@ -7,14 +7,24 @@
  * http://jquery.org/license
  *
  * http://api.jqueryui.com/selectmenu
- *
- * Depends:
- *     jquery.ui.core.js
- *     jquery.ui.widget.js
- *     jquery.ui.position.js
- *     jquery.ui.menu.js
  */
-(function( $, undefined ) {
+(function( factory ) {
+       if ( typeof define === "function" && define.amd ) {
+
+               // AMD. Register as an anonymous module.
+               define([
+                       "jquery",
+                       "./core",
+                       "./widget",
+                       "./position",
+                       "./menu"
+               ], factory );
+       } else {
+
+               // Browser globals
+               factory( jQuery );
+       }
+}(function( $ ) {
 
 return $.widget( "ui.selectmenu", {
        version: "@VERSION",
@@ -533,4 +543,4 @@ return $.widget( "ui.selectmenu", {
        }
 });
 
-}( jQuery ));
+}));