sydcanem / bootstrap-contextmenu

Context menu plugin for Twitter's Bootstrap framework
http://sydcanem.com/bootstrap-contextmenu/
645 stars 193 forks source link

`before` function requires returning true to show #77

Closed dsherret closed 9 years ago

dsherret commented 9 years ago

Code on README.MD doesn't work:

$('.context').contextmenu({
  target:'#context-menu', 
  before: function(e,context) {
  }
});

You have to explicitly return true to get this to work:

$('.context').contextmenu({
  target:'#context-menu', 
  before: function(e,context) {
    return true;
  }
});

The documentation says:

If this function returns false, the context menu will not be displayed.

...but the functionality is more like:

If this function returns true, the context menu will be displayed.

I have submitted a pull request (#76) with the fix and unit tests for this issue.

mjau-mjau commented 9 years ago

+1

sydcanem commented 9 years ago

Merged. Thanks.