Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling integration with jQueryUI #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
default_options = {
shiftDisable : false, // Allow access to native contextMenu by rightclick + shift
disable_native_context_menu: false, // disables the native contextmenu everywhere you click
leftClick: false // show menu on left mouse click instead of right
leftClick: false, // show menu on left mouse click instead of right
jqui: false // enable integration with jQuery-UI
},
options = $.extend(default_options, options);

Expand All @@ -47,11 +48,15 @@
} else {
var link = '<a href="#">'+me+'</a>';
}

if (itemOptions.icon && options.jqui) {
link = '<span class="ui-icon ' + itemOptions.icon + '"></span>' + link;
}

var menuItem = $('<li>' + link + '</li>');

if (itemOptions.klass) {
menuItem.attr("class", itemOptions.klass);
menuItem.addClass(itemOptions.klass);
}

menuItem.appendTo(menu).bind('click', function(e) {
Expand Down Expand Up @@ -103,6 +108,7 @@

menu.show(0, function() {
$('body').bind('click', hideMenu);
if (options.jqui){$('.context-menu').menu();}
}).css({
visibility: 'visible',
top: yPos + 'px',
Expand Down