Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Not working on XHTML page. #46

Closed
poofeg opened this issue Dec 16, 2013 · 1 comment
Closed

Not working on XHTML page. #46

poofeg opened this issue Dec 16, 2013 · 1 comment
Assignees
Labels

Comments

@poofeg
Copy link

poofeg commented Dec 16, 2013

Plugin not working on XHTML page. Same page with HTML content type works. In console:

Uncaught SyntaxError: An invalid or illegal string was specified. jquery.js:6469
jQuery.extend.buildFragment jquery.js:6469
jQuery.extend.parseHTML jquery.js:531
jQuery.fn.jQuery.init jquery.js:149
jQuery jquery.js:62
$.widget._create jquery.ui-contextmenu.js:56
(anonymous function) jquery-ui.js:401
$.Widget._createWidget jquery-ui.js:560
$.(anonymous function).(anonymous function) jquery-ui.js:362
(anonymous function) jquery-ui.js:507
jQuery.extend.each jquery.js:648
jQuery.fn.jQuery.each jquery.js:270
$.fn.(anonymous function) jquery-ui.js:502
(anonymous function) index.xhtml:251
fire jquery.js:1037
self.fireWith jquery.js:1148
jQuery.extend.ready jquery.js:433
completed jquery.js:103
@poofeg
Copy link
Author

poofeg commented Dec 16, 2013

This solves the problem:

--- jquery.ui-contextmenu.js    2013-10-19 12:48:52.000000000 +0600
+++ jquery.ui-contextmenu.xhtml.js  2013-12-16 17:43:21.656726112 +0600
@@ -53,7 +53,7 @@
                // If the contextmenu was bound to `document`, we apply the
                // selector relative to the  tag instead
                targetId = ($(this.element).is(document) ? $("body") : this.element).uniqueId().attr("id");
-               this.$headStyle = $("<style class='moogle-contextmenu-style'>")
+               this.$headStyle = $("<style class='moogle-contextmenu-style' />")
                    .prop("type", "text/css")
                    .html("#" + targetId + " " + opts.delegate + " { " +
                        "-webkit-user-select: none; " +
@@ -302,7 +302,7 @@
            // hyphen, em dash, en dash: separator as defined by UI Menu 1.10
            $parentLi.text(entry.title);
        }else{
-           $a = $("", {
+           $a = $("", {
                text: "" + entry.title,
                href: "#" + normCommand(entry.cmd)
            }).appendTo($parentLi);
@@ -310,7 +310,7 @@
                $a.data("actionHandler", entry.action);
            }
            if(entry.uiIcon){
-               $a.append($("").addClass(entry.uiIcon));
+               $a.append($("").addClass(entry.uiIcon));
            }
            if(entry.disabled){
                $parentLi.addClass("ui-state-disabled");
@@ -325,16 +325,16 @@
    createMenuMarkup: function(options, $parentUl){
        var i, menu, $ul, $li;
        if( $parentUl == null ){
-           $parentUl = $("
    ").appendTo("body"); + $parentUl = $("
      ").appendTo("body"); } for(i = 0; i < options.length; i++){ menu = options[i]; - $li = $("
    • ").appendTo($parentUl); + $li = $("
    • ").appendTo($parentUl); $.moogle.contextmenu.createEntryMarkup(menu, $li); if( $.isArray(menu.children) ){ - $ul = $("
        ").appendTo($li); + $ul = $("
          ").appendTo($li); $.moogle.contextmenu.createMenuMarkup(menu.children, $ul); } }

@ghost ghost assigned mar10 Dec 16, 2013
@mar10 mar10 closed this as completed in 3b3e469 Dec 18, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants