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

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

Issue 3346006: NTP: Add transitions. (Closed)
Patch Set: formatting 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.js ('k') | chrome/browser/resources/ntp/most_visited.js » ('j') | 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('recieved apps'); 6 logEvent('recieved 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 return; 15 return;
16 } 16 }
17 17
18 data.apps.forEach(function(app) { 18 data.apps.forEach(function(app) {
19 appsSectionContent.appendChild(apps.createElement(app)); 19 appsSectionContent.appendChild(apps.createElement(app));
20 }); 20 });
21 21
22 appsSectionContent.appendChild(apps.createWebStoreElement()); 22 appsSectionContent.appendChild(apps.createWebStoreElement());
23 23
24 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) { 24 data.apps.slice(0, MAX_MINIVIEW_ITEMS).forEach(function(app) {
25 appsMiniview.appendChild(apps.createMiniviewElement(app)); 25 appsMiniview.appendChild(apps.createMiniviewElement(app));
26 }); 26 });
27 27
28 appsSection.classList.remove('disabled'); 28 appsSection.classList.remove('disabled');
29 updateMiniviewClipping(appsMiniview);
29 layoutSections(); 30 layoutSections();
30 } 31 }
31 32
32 var apps = { 33 var apps = {
33 /** 34 /**
34 * @this {!HTMLAnchorElement} 35 * @this {!HTMLAnchorElement}
35 */ 36 */
36 handleClick_: function() { 37 handleClick_: function() {
37 // TODO(arv): Handle zoom? 38 // TODO(arv): Handle zoom?
38 var rect = this.getBoundingClientRect(); 39 var rect = this.getBoundingClientRect();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }, 131 },
131 132
132 createWebStoreElement: function() { 133 createWebStoreElement: function() {
133 return this.createElement_({ 134 return this.createElement_({
134 'id': 'web-store-entry', 135 'id': 'web-store-entry',
135 'name': localStrings.getString('web_store_title'), 136 'name': localStrings.getString('web_store_title'),
136 'launch_url': localStrings.getString('web_store_url') 137 'launch_url': localStrings.getString('web_store_url')
137 }); 138 });
138 } 139 }
139 }; 140 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/new_new_tab.js ('k') | chrome/browser/resources/ntp/most_visited.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698