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

Side by Side Diff: chrome/browser/resources/ntp/apps.js

Issue 3393013: Fix a bug where we would show both the apps and thumb sections (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: whoops Created 10 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function getAppsCallback(data) { 5 function getAppsCallback(data) {
6 logEvent('received apps'); 6 logEvent('received apps');
7 var appsSection = $('apps'); 7 var appsSection = $('apps');
8 var appsSectionContent = $('apps-maxiview'); 8 var appsSectionContent = $('apps-maxiview');
9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; 9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0];
10 appsSectionContent.textContent = ''; 10 appsSectionContent.textContent = '';
11 appsMiniview.textContent = ''; 11 appsMiniview.textContent = '';
12 12
13 if (data.apps.length == 0) { 13 if (data.apps.length == 0) {
14 appsSection.classList.add('disabled'); 14 appsSection.classList.add('disabled');
15 layoutSections(); 15 setShownSections(Section.THUMB);
16 return; 16 return;
17 } 17 }
18 18
19 data.apps.forEach(function(app) { 19 data.apps.forEach(function(app) {
20 appsSectionContent.appendChild(apps.createElement(app)); 20 appsSectionContent.appendChild(apps.createElement(app));
21 }); 21 });
22 22
23 appsSectionContent.appendChild(apps.createWebStoreElement()); 23 appsSectionContent.appendChild(apps.createWebStoreElement());
24 24
25 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { 25 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 createWebStoreElement: function() { 192 createWebStoreElement: function() {
193 return createElement({ 193 return createElement({
194 'id': 'web-store-entry', 194 'id': 'web-store-entry',
195 'name': localStrings.getString('web_store_title'), 195 'name': localStrings.getString('web_store_title'),
196 'launch_url': localStrings.getString('web_store_url') 196 'launch_url': localStrings.getString('web_store_url')
197 }); 197 });
198 } 198 }
199 }; 199 };
200 })(); 200 })();
OLDNEW
« no previous file with comments | « 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