53
53
// If the contextmenu was bound to `document`, we apply the
54
54
// selector relative to the <body> tag instead
55
55
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' / >" )
57
57
. prop ( "type" , "text/css" )
58
58
. html ( "#" + targetId + " " + opts . delegate + " { " +
59
59
"-webkit-user-select: none; " +
@@ -302,15 +302,15 @@ $.extend($.moogle.contextmenu, {
302
302
// hyphen, em dash, en dash: separator as defined by UI Menu 1.10
303
303
$parentLi . text ( entry . title ) ;
304
304
} else {
305
- $a = $ ( "<a>" , {
305
+ $a = $ ( "<a/ >" , {
306
306
text : "" + entry . title ,
307
307
href : "#" + normCommand ( entry . cmd )
308
308
} ) . appendTo ( $parentLi ) ;
309
309
if ( $ . isFunction ( entry . action ) ) {
310
310
$a . data ( "actionHandler" , entry . action ) ;
311
311
}
312
312
if ( entry . uiIcon ) {
313
- $a . append ( $ ( "<span class='ui-icon'>" ) . addClass ( entry . uiIcon ) ) ;
313
+ $a . append ( $ ( "<span class='ui-icon' / >" ) . addClass ( entry . uiIcon ) ) ;
314
314
}
315
315
if ( entry . disabled ) {
316
316
$parentLi . addClass ( "ui-state-disabled" ) ;
@@ -325,16 +325,16 @@ $.extend($.moogle.contextmenu, {
325
325
createMenuMarkup : function ( options , $parentUl ) {
326
326
var i , menu , $ul , $li ;
327
327
if ( $parentUl == null ) {
328
- $parentUl = $ ( "<ul class='ui-helper-hidden'>" ) . appendTo ( "body" ) ;
328
+ $parentUl = $ ( "<ul class='ui-helper-hidden' / >" ) . appendTo ( "body" ) ;
329
329
}
330
330
for ( i = 0 ; i < options . length ; i ++ ) {
331
331
menu = options [ i ] ;
332
- $li = $ ( "<li>" ) . appendTo ( $parentUl ) ;
332
+ $li = $ ( "<li/ >" ) . appendTo ( $parentUl ) ;
333
333
334
334
$ . moogle . contextmenu . createEntryMarkup ( menu , $li ) ;
335
335
336
336
if ( $ . isArray ( menu . children ) ) {
337
- $ul = $ ( "<ul>" ) . appendTo ( $li ) ;
337
+ $ul = $ ( "<ul/ >" ) . appendTo ( $li ) ;
338
338
$ . moogle . contextmenu . createMenuMarkup ( menu . children , $ul ) ;
339
339
}
340
340
}
0 commit comments