Skip to content

Commit 599ea7c

Browse files
committed
Allow to show/hide separators
Close mar10#98
1 parent 7a22327 commit 599ea7c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.10.1-0 / Unreleased
22

33
* [FEATURE] #94 Add `main` field to package.json
4+
* [CHANGE] #98 Allow to show/hide separators
45

56
# 1.10.0 / 2015-06-27
67

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ $(document).contextmenu({
8787
});
8888
```
8989
**Note:** only one contextmenu widget instance can be bound to one element.
90+
See the *Howto* below for a solution to this problem.
9091

9192
The `menu` options may contain a (nested) array of entry defiitions.
9293
Following a list of available properties:

jquery.ui-contextmenu.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,14 @@ $.extend($.moogle.contextmenu, {
377377
createEntryMarkup: function(entry, $parentLi) {
378378
var $a = null;
379379

380+
$parentLi.attr("data-command", entry.cmd);
381+
380382
if ( !/[^\-\u2014\u2013\s]/.test( entry.title ) ) {
381383
// hyphen, em dash, en dash: separator as defined by UI Menu 1.10
382384
$parentLi.text(entry.title);
383385
} else {
384386
if ( isLTE110 ) {
385387
// jQuery UI Menu 1.10 or before required an `<a>` tag
386-
$parentLi.attr("data-command", entry.cmd);
387388
$a = $("<a/>", {
388389
html: "" + entry.title,
389390
href: "#"
@@ -395,9 +396,7 @@ $.extend($.moogle.contextmenu, {
395396

396397
} else {
397398
// jQuery UI Menu 1.11+ preferes to avoid `<a>` tags
398-
$parentLi
399-
.attr("data-command", entry.cmd)
400-
.html("" + entry.title);
399+
$parentLi.html("" + entry.title);
401400
if ( $.isFunction(entry.action) ) {
402401
$parentLi.data("actionHandler", entry.action);
403402
}

0 commit comments

Comments
 (0)