Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #31190 from BorisChiou/Bug952456
Browse files Browse the repository at this point in the history
Bug 952456 - Add "Copy Image" option, r=timdream, kanru
  • Loading branch information
timdream committed Aug 24, 2015
2 parents cddb9f6 + 31fbbc0 commit 22fba58
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
29 changes: 21 additions & 8 deletions apps/system/js/browser_context_menu.js
Expand Up @@ -70,16 +70,29 @@
var items = [];

// contextmenu.items are specified by the web content via html5
// context menu api
// context menu api and a specific system command, copy-image.
if (detail.contextmenu && detail.contextmenu.items.length) {
detail.contextmenu.items.forEach(function(choice, index) {
items.push({
label: choice.label,
icon: choice.icon,
callback: function() {
detail.contextMenuItemSelected(choice.id);
}
});
var itemObj = null;
switch (choice.id) {
case 'copy-image':
itemObj = {
id: choice.id,
label: _(choice.id),
};
break;

default:
// Customized menu items
itemObj = {
label: choice.label,
icon: choice.icon,
};
}
itemObj.callback = () => {
detail.contextMenuItemSelected(choice.id);
};
items.push(itemObj);
}, this);
}

Expand Down
1 change: 1 addition & 0 deletions apps/system/locales/system.en-US.properties
Expand Up @@ -600,6 +600,7 @@ save-link=Save linked file
share-image=Share Image
share-video=Share Video
share-audio=Share Audio
copy-image=Copy Image

# Private Browser
private-window=Private Window
Expand Down

0 comments on commit 22fba58

Please sign in to comment.