| Index: chrome/browser/resources/ntp/apps.js
|
| diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js
|
| index 68a1be61ecebd8444af07cf08b601fcfe1805ab8..70018aa7e1eebbae0a895757881b059dd749415b 100644
|
| --- a/chrome/browser/resources/ntp/apps.js
|
| +++ b/chrome/browser/resources/ntp/apps.js
|
| @@ -10,6 +10,7 @@ function getAppsCallback(data) {
|
| appsSectionContent.textContent = '';
|
| appsMiniview.textContent = '';
|
|
|
| + clearClosedMenu(apps.menu);
|
| if (data.apps.length == 0) {
|
| appsSection.classList.add('disabled');
|
| layoutSections();
|
| @@ -22,10 +23,14 @@ function getAppsCallback(data) {
|
|
|
| data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
|
| appsMiniview.appendChild(apps.createMiniviewElement(app));
|
| + addClosedMenuEntryWithLink(apps.menu, apps.createClosedMenuElement(app));
|
| });
|
|
|
| - appsSection.classList.remove('disabled');
|
| + if (!(shownSections & MINIMIZED_APPS)) {
|
| + appsSection.classList.remove('disabled');
|
| + }
|
| }
|
| + addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS);
|
|
|
| apps.loaded = true;
|
| maybeDoneLoading();
|
| @@ -199,6 +204,8 @@ var apps = (function() {
|
| return {
|
| loaded: false,
|
|
|
| + menu: $('apps-menu'),
|
| +
|
| createElement: function(app) {
|
| var div = createElement(app);
|
| var a = div.firstChild;
|
| @@ -221,7 +228,8 @@ var apps = (function() {
|
| document.documentElement.setAttribute("install-animation-enabled",
|
| "false");
|
| });
|
| - if ($('apps').classList.contains('hidden'))
|
| + if ($('apps').classList.contains('hidden') &&
|
| + !(shownSections & MINIMIZED_APPS))
|
| toggleSectionVisibilityAndAnimate('APPS');
|
| }
|
|
|
| @@ -251,6 +259,17 @@ var apps = (function() {
|
| return span;
|
| },
|
|
|
| + createClosedMenuElement: function(app) {
|
| + var a = document.createElement('a');
|
| + a.setAttribute('app-id', app['id']);
|
| + a.textContent = app['name'];
|
| + a.href = app['launch_url'];
|
| + a.onclick = handleClick;
|
| + a.style.backgroundImage = url(app['icon_small']);
|
| + a.className = 'item';
|
| + return a;
|
| + },
|
| +
|
| createWebStoreElement: function() {
|
| return createElement({
|
| 'id': 'web-store-entry',
|
|
|