summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/ntp/apps.js
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:38:31 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-20 00:38:31 +0000
commit09a9da72051e7543bd800167c88e5d56c523b5fe (patch)
treefef4e6a8108a6a4d4fed28260e7ff88271e09a78 /chrome/browser/resources/ntp/apps.js
parent2899a5fb68f985f6565ab7b43c158a60ea0ed1ee (diff)
downloadchromium_src-09a9da72051e7543bd800167c88e5d56c523b5fe.zip
chromium_src-09a9da72051e7543bd800167c88e5d56c523b5fe.tar.gz
chromium_src-09a9da72051e7543bd800167c88e5d56c523b5fe.tar.bz2
NTP: Fix context menu for apps in small and minimized mode.
BUG=63415 TEST=Install and App. Go to the NTP Right clicking on the app in expanded/small/minimized mode This should bring up a context menu in all cases. Review URL: http://codereview.chromium.org/5234005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/ntp/apps.js')
-rw-r--r--chrome/browser/resources/ntp/apps.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js
index 7069231..c8638c6 100644
--- a/chrome/browser/resources/ntp/apps.js
+++ b/chrome/browser/resources/ntp/apps.js
@@ -97,11 +97,6 @@ var apps = (function() {
return div;
}
- function createContextMenu(app) {
- var menu = new cr.ui.Menu;
- var button = document.createElement(button);
- }
-
function launchApp(appId) {
var appsSection = $('apps');
var expanded = !appsSection.classList.contains('hidden');
@@ -174,10 +169,15 @@ var apps = (function() {
$('apps-launch-command').label = app['name'];
$('apps-options-command').canExecuteChange();
- var appLinkSel = '.app a[app-id=' + app['id'] + ']';
- var launchType =
- el.querySelector(appLinkSel).getAttribute('launch-type');
+ var launchTypeEl;
+ if (el.getAttribute('app-id') === app['id']) {
+ launchTypeEl = el;
+ } else {
+ appLinkSel = 'a[app-id=' + app['id'] + ']';
+ launchTypeEl = el.querySelector(appLinkSel);
+ }
+ var launchType = launchTypeEl.getAttribute('launch-type');
var launchContainer = app['launch_container'];
var isPanel = launchContainer == LaunchContainer.LAUNCH_PANEL;
@@ -304,6 +304,9 @@ var apps = (function() {
a.setAttribute('ping', PING_APP_LAUNCH_PREFIX + '+' + this.showPromo);
a.style.backgroundImage = url(app['icon_small']);
a.className = 'item';
+
+ addContextMenu(a, app);
+
return a;
},