OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 cr.define('ntp4', function() { | 5 cr.define('ntp4', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var localStrings = new LocalStrings; | 8 var localStrings = new LocalStrings; |
9 | 9 |
10 var APP_LAUNCH = { | 10 var APP_LAUNCH = { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 // image when it's touched. | 187 // image when it's touched. |
188 appImg.style.WebkitMaskImage = url(this.appData_.icon_big); | 188 appImg.style.WebkitMaskImage = url(this.appData_.icon_big); |
189 // We put a click handler just on the app image - so clicking on the | 189 // We put a click handler just on the app image - so clicking on the |
190 // margins between apps doesn't do anything. | 190 // margins between apps doesn't do anything. |
191 appImg.addEventListener('click', this.onClick_.bind(this)); | 191 appImg.addEventListener('click', this.onClick_.bind(this)); |
192 appContents.appendChild(appImg); | 192 appContents.appendChild(appImg); |
193 this.appImg_ = appImg; | 193 this.appImg_ = appImg; |
194 | 194 |
195 var appSpan = this.ownerDocument.createElement('span'); | 195 var appSpan = this.ownerDocument.createElement('span'); |
196 appSpan.textContent = this.appData_.name; | 196 appSpan.textContent = this.appData_.name; |
197 appSpan.addEventListener('click', this.onClick_.bind(this)); | |
Rick Byers
2011/08/03 14:41:11
Why add a handler to both the img and span. Would
Evan Stade
2011/08/03 22:11:22
the clickable contour is a little different
| |
197 appContents.appendChild(appSpan); | 198 appContents.appendChild(appSpan); |
198 this.appendChild(appContents); | 199 this.appendChild(appContents); |
199 | 200 |
200 this.addEventListener('keydown', cr.ui.contextMenuHandler); | 201 this.addEventListener('keydown', cr.ui.contextMenuHandler); |
201 this.addEventListener('keyup', cr.ui.contextMenuHandler); | 202 this.addEventListener('keyup', cr.ui.contextMenuHandler); |
202 | 203 |
203 // This hack is here so that appContents.contextMenu will be the same as | 204 // This hack is here so that appContents.contextMenu will be the same as |
204 // this.contextMenu. | 205 // this.contextMenu. |
205 var self = this; | 206 var self = this; |
206 appContents.__defineGetter__('contextMenu', function() { | 207 appContents.__defineGetter__('contextMenu', function() { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 }, | 430 }, |
430 }; | 431 }; |
431 | 432 |
432 AppsPage.setPromo = function(data) { | 433 AppsPage.setPromo = function(data) { |
433 var store = document.querySelector('.webstore'); | 434 var store = document.querySelector('.webstore'); |
434 if (store) | 435 if (store) |
435 store.setAppsPromoData(data); | 436 store.setAppsPromoData(data); |
436 }; | 437 }; |
437 | 438 |
438 return { | 439 return { |
440 APP_LAUNCH: APP_LAUNCH, | |
439 AppsPage: AppsPage, | 441 AppsPage: AppsPage, |
440 }; | 442 }; |
441 }); | 443 }); |
OLD | NEW |