Skip to content

Commit c5923bb

Browse files
committed
setEntry() and replaceMenu() now allow to define titles with HTML markup
Closed mar10#54
1 parent 33a3ac6 commit c5923bb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.3.0 / unreleased
22

3-
* [FEATURE] New optional parameter open(..., extraData)
3+
* [FEATURE] New optional parameter open(..., extraData).
4+
* [CHANGE] `setEntry()` and `replaceMenu()` now allow to define titles with HTML markup.
45

56
# 1.2.4 / 2013-12-25
67

demo/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
preventSelect: true,
8282
taphold: true,
8383
menu: [
84-
{title: "Cut", cmd: "cut", uiIcon: "ui-icon-scissors"},
84+
{title: "<strong>Cut</strong>", cmd: "cut", uiIcon: "ui-icon-scissors"},
8585
{title: "Copy", cmd: "copy", uiIcon: "ui-icon-copy"},
8686
{title: "Paste", cmd: "paste", uiIcon: "ui-icon-clipboard", disabled: true },
8787
{title: "----"},
@@ -213,7 +213,7 @@ <h3>Sample 2</h3>
213213

214214
<ul id="options" style="display: none;">
215215
<li><a href="#action1"><span class="ui-icon custom-icon-firefox"></span>Action 1</a>
216-
<li><a href="#action2"><span class="ui-icon ui-icon-heart"></span>Action 2</a>
216+
<li><a href="#action2"><span class="ui-icon ui-icon-heart"></span><strong>Action</strong> 2</a>
217217
<li class="ui-state-disabled"><a href="#action3">Action 3</a>
218218
<li>----
219219
<li><a>Extra</a>

jquery.ui-contextmenu.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ $.extend($.moogle.contextmenu, {
313313
$parentLi.text(entry.title);
314314
}else{
315315
$a = $("<a/>", {
316-
text: "" + entry.title,
316+
// text: "" + entry.title,
317+
html: "" + entry.title, // allow to pass HTML markup
317318
href: "#" + normCommand(entry.cmd)
318319
}).appendTo($parentLi);
319320
if( $.isFunction(entry.action) ){

0 commit comments

Comments
 (0)