Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/ext/background.js

Issue 4808773210210304: Issue 437 - Fixed broken onclick handler for context menu entries (Closed)
Patch Set: Created May 7, 2014, 6:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/ext/background.js
===================================================================
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -194,14 +194,17 @@
if (!items)
return;
- for (var i = 0; i < items.length; i++)
+ items.forEach(function(item)
{
chrome.contextMenus.create({
- title: items[i].title,
- contexts: items[i].contexts,
- onclick: items[i].onclick
+ title: item.title,
+ contexts: item.contexts,
+ onclick: function(info, tab)
+ {
+ item.onclick(info.srcUrl, new Page(tab));
+ }
});
- }
+ });
});
});
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld