Skip to content

Commit 3b3e469

Browse files
committed
Fixed 'Not working on XHTML page' (thnks to poofeg)
closed mar10#46
1 parent 6374099 commit 3b3e469

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.4 / unreleased
2+
3+
* [BUGFIX] Fixed #46 'Not working on XHTML page' (poofeg)
4+
15
# 1.2.3 / 2013-10-19
26

37
* [CHANGE] Detection of separators compliant with UI Menu 1.10

jquery.ui-contextmenu.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
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

Comments
 (0)