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

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

Issue 3250002: Add an accordian effect to NTP. (Closed)
Patch Set: Fix menu positioning when there is a scrollbar. 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
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('recieved apps'); 6 logEvent('recieved apps');
7 var appsSection = $('apps-section'); 7 var appsSection = $('apps-section');
8 var appsSectionContent = $('apps-section-content'); 8 var appsSectionContent = $('apps-section-content');
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 data.apps.forEach(function(app) { 13 data.apps.forEach(function(app) {
14 appsSectionContent.appendChild(apps.createElement(app)); 14 appsSectionContent.appendChild(apps.createElement(app));
15 }); 15 });
16 16
17 appsSectionContent.appendChild(apps.createWebStoreElement()); 17 appsSectionContent.appendChild(apps.createWebStoreElement());
18 18
19 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { 19 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
20 appsMiniview.appendChild(apps.createMiniviewElement(app)); 20 appsMiniview.appendChild(apps.createMiniviewElement(app));
21 }); 21 });
22
23 layoutSections();
22 } 24 }
23 25
24 var apps = { 26 var apps = {
25 /** 27 /**
26 * @this {!HTMLAnchorElement} 28 * @this {!HTMLAnchorElement}
27 */ 29 */
28 handleClick_: function() { 30 handleClick_: function() {
29 var launchType = ''; 31 var launchType = '';
30 var inputElements = document.querySelectorAll( 32 var inputElements = document.querySelectorAll(
31 '#apps-launch-control input'); 33 '#apps-launch-control input');
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 }, 134 },
133 135
134 createWebStoreElement: function() { 136 createWebStoreElement: function() {
135 return this.createElement_({ 137 return this.createElement_({
136 'id': 'web-store-entry', 138 'id': 'web-store-entry',
137 'name': localStrings.getString('web_store_title'), 139 'name': localStrings.getString('web_store_title'),
138 'launch_url': localStrings.getString('web_store_url') 140 'launch_url': localStrings.getString('web_store_url')
139 }); 141 });
140 } 142 }
141 }; 143 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698