5353 // If the contextmenu was bound to `document`, we apply the
5454 // selector relative to the <body> tag instead
5555 targetId = ( $ ( this . element ) . is ( document ) ? $ ( "body" ) : this . element ) . uniqueId ( ) . attr ( "id" ) ;
56- this . $headStyle = $ ( "<style class='moogle-contextmenu-style'>" )
56+ this . $headStyle = $ ( "<style class='moogle-contextmenu-style' / >" )
5757 . prop ( "type" , "text/css" )
5858 . html ( "#" + targetId + " " + opts . delegate + " { " +
5959 "-webkit-user-select: none; " +
@@ -302,15 +302,15 @@ $.extend($.moogle.contextmenu, {
302302 // hyphen, em dash, en dash: separator as defined by UI Menu 1.10
303303 $parentLi . text ( entry . title ) ;
304304 } else {
305- $a = $ ( "<a>" , {
305+ $a = $ ( "<a/ >" , {
306306 text : "" + entry . title ,
307307 href : "#" + normCommand ( entry . cmd )
308308 } ) . appendTo ( $parentLi ) ;
309309 if ( $ . isFunction ( entry . action ) ) {
310310 $a . data ( "actionHandler" , entry . action ) ;
311311 }
312312 if ( entry . uiIcon ) {
313- $a . append ( $ ( "<span class='ui-icon'>" ) . addClass ( entry . uiIcon ) ) ;
313+ $a . append ( $ ( "<span class='ui-icon' / >" ) . addClass ( entry . uiIcon ) ) ;
314314 }
315315 if ( entry . disabled ) {
316316 $parentLi . addClass ( "ui-state-disabled" ) ;
@@ -325,16 +325,16 @@ $.extend($.moogle.contextmenu, {
325325 createMenuMarkup : function ( options , $parentUl ) {
326326 var i , menu , $ul , $li ;
327327 if ( $parentUl == null ) {
328- $parentUl = $ ( "<ul class='ui-helper-hidden'>" ) . appendTo ( "body" ) ;
328+ $parentUl = $ ( "<ul class='ui-helper-hidden' / >" ) . appendTo ( "body" ) ;
329329 }
330330 for ( i = 0 ; i < options . length ; i ++ ) {
331331 menu = options [ i ] ;
332- $li = $ ( "<li>" ) . appendTo ( $parentUl ) ;
332+ $li = $ ( "<li/ >" ) . appendTo ( $parentUl ) ;
333333
334334 $ . moogle . contextmenu . createEntryMarkup ( menu , $li ) ;
335335
336336 if ( $ . isArray ( menu . children ) ) {
337- $ul = $ ( "<ul>" ) . appendTo ( $li ) ;
337+ $ul = $ ( "<ul/ >" ) . appendTo ( $li ) ;
338338 $ . moogle . contextmenu . createMenuMarkup ( menu . children , $ul ) ;
339339 }
340340 }
0 commit comments