You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
On a menu that has an item whose cmd is "toggle_html" ... this should update the title and change the menu icon. This worked before (I am upgrading from contextmenu 1.3 -> contextmenu 1.13 and from jQuery 1.11).
The bug is that the menu item is replaced but with the incorrect/missing attibutes in the <div ...> ... so that the displayed menu looks broken. I.e. the inspected HTML after execution of this command should look like:
<divid="ui-id-4"class="ui-menu-item-wrapper"tabindex="-1"role="menuitem">
Display HTML Content - Shift-H
<spanclass="ui-icon ui-icon-check"></span></div>
But instead it looks like:
<div>
Display HTML Content - Shift-H
<spanclass="ui-icon ui-icon-check"></span></div>
I have worked around the problem for now by re-writing setEntry to set the title and icon explicitly rather than using the full hash reset option in there.
/** Redefine menu entry (title or all of it). */
setEntry: function(cmd,entry){var$ul,$entryLi=this._getMenuEntry(cmd);if(typeofentry==="string"){$.moogle.contextmenu.updateTitle($entryLi,entry);}// LuxSci: The "else" below breaks things...elseif(entry.title&&entry.uiIcon&&!entry.cmd){$.moogle.contextmenu.updateTitle($entryLi,entry.title);$.moogle.contextmenu.updateIcon($entryLi,entry.uiIcon);}else{$entryLi.empty();entry.cmd=entry.cmd||cmd;$.moogle.contextmenu.createEntryMarkup(entry,$entryLi);if($.isArray(entry.children)){$ul=$("<ul/>").appendTo($entryLi);$.moogle.contextmenu.createMenuMarkup(entry.children,$ul);}this.getMenu().menu("refresh");}},/** Updates the menu item's icon *//* LuxSci Addition */updateIcon: function(item,icon){// jQ 1.12 only$("span",item).attr("class","ui-icon "+icon);}
This works and restores full normal behavior. I would guess that something is broken in
combined with the createEntryMarkup function that is leaving all oft he internal attributes off of the <div /> when it is re-created. I didn't dig further into it than this.
The text was updated successfully, but these errors were encountered:
This is using jQuery UI v1.12.1 and jQuery v1.12.4; context menu v 1.13.0
Expected
On a menu that has an item whose cmd is "toggle_html" ... this should update the title and change the menu icon. This worked before (I am upgrading from contextmenu 1.3 -> contextmenu 1.13 and from jQuery 1.11).
The bug is that the menu item is replaced but with the incorrect/missing attibutes in the
<div ...>
... so that the displayed menu looks broken. I.e. the inspected HTML after execution of this command should look like:But instead it looks like:
I have worked around the problem for now by re-writing setEntry to set the title and icon explicitly rather than using the full hash reset option in there.
This works and restores full normal behavior. I would guess that something is broken in
combined with the createEntryMarkup function that is leaving all oft he internal attributes off of the
<div />
when it is re-created. I didn't dig further into it than this.The text was updated successfully, but these errors were encountered: