Skip to content

Commit

Permalink
Added method to open contextMenu dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed Apr 2, 2015
1 parent 2e433a4 commit b0d968b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Sudhanshu Yadav",
"email": "[email protected]"
},
"version": "1.2.3",
"version": "1.3.0",
"repository": {
"type": "git",
"url": "https://github.com/s-yadav/contextMenu.js"
Expand Down
11 changes: 10 additions & 1 deletion contextMenu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
*contextMenu.js v 1.2.3
*contextMenu.js v 1.3.0
*Author: Sudhanshu Yadav
*s-yadav.github.com
*Copyright (c) 2013 Sudhanshu Yadav.
Expand Down Expand Up @@ -157,6 +157,15 @@
menuData.option.baseTrigger = this;
iMethods.contextMenuBind.call(newElm, menuData.menuSelector, menuData.option);
},
open: function(sel,data){
data = data || {};
var e = data.event || new Event('click');
if(data.top) e.clientY = data.top;
if(data.left) e.clientX = data.left;
this.each(function(){
iMethods.eventHandler.call(this,e);
});
},
//to force context menu to close
close: function () {
var menuData = this.data('iw-menuData');
Expand Down
2 changes: 1 addition & 1 deletion contextMenu.js.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contextMenu.js",
"version": "1.2.3",
"version": "1.3.0",
"title": "A light weight multi functional context menu plugin",
"author": {
"name": "Sudhanshu Yadav",
Expand Down
Loading

0 comments on commit b0d968b

Please sign in to comment.