File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1- # 1.13.0 -0 / Unreleased
2- *
1+ # 1.13.1 -0 / Unreleased
2+ * [ BUGFIX ] # 109 Fix ` setEntry(title) ` for titles containing icons
33
44# 1.13.0 / 2016-08-21
55
Original file line number Diff line number Diff line change @@ -476,13 +476,14 @@ $.extend($.moogle.contextmenu, {
476476 return item . has ( ">div[aria-haspopup='true']" ) . length > 0 ;
477477 }
478478 } ,
479- /** Replaces the value of elem's first text node child */
480- replaceFirstTextNodeChild : function ( elem , text ) {
479+ /** Replace the title of elem', but retain icons andchild entries. */
480+ replaceFirstTextNodeChild : function ( elem , html ) {
481+ var $icons = elem . find ( ">span.ui-icon,>ul.ui-menu" ) . detach ( ) ;
482+
481483 elem
482- . contents ( )
483- . filter ( function ( ) { return this . nodeType === 3 ; } )
484- . first ( )
485- . replaceWith ( text ) ;
484+ . empty ( )
485+ . html ( html )
486+ . append ( $icons ) ;
486487 } ,
487488 /** Updates the menu item's title */
488489 updateTitle : function ( item , title ) {
You can’t perform that action at this time.
0 commit comments