From fe420c0eaccb490e2f66423c60a896b88da79395 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Fri, 21 Feb 2014 14:56:13 -0500 Subject: [PATCH] Selectmenu: Add UMD wrapper --- ui/selectmenu.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ui/selectmenu.js b/ui/selectmenu.js index 66398a6e3..2a89d9dd0 100644 --- a/ui/selectmenu.js +++ b/ui/selectmenu.js @@ -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 )); +}));