Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1745)

Unified Diff: chrome/browser/resources/ntp/apps.js

Issue 5234005: NTP: Fix context menu for apps in small and minimized mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the menu items too Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/ntp/apps.js
diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js
index 7069231791796f6567bf1db4a89a6506139f5f25..c8638c601fd3d72b22f3ca19f6a9ef72c477f13c 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) {
arv (Not doing code reviews) 2010/11/19 22:31:36 dead code
- 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;
},
« chrome/browser/resources/new_new_tab.html ('K') | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698