OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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('ntp', function() { | 5 cr.define('ntp', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var Tile = ntp.Tile; | 8 var Tile = ntp.Tile; |
9 var TilePage = ntp.TilePage; | 9 var TilePage = ntp.TilePage; |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 | 49 |
50 this.tabIndex = -1; | 50 this.tabIndex = -1; |
51 this.data_ = null; | 51 this.data_ = null; |
52 this.title = ''; | 52 this.title = ''; |
53 }, | 53 }, |
54 | 54 |
55 /** | 55 /** |
56 * Update the appearance of this tile according to |data|. | 56 * Update the appearance of this tile according to |data|. |
57 * @param {Object} data A dictionary of relevant data for the page. | 57 * @param {Object} data A dictionary of relevant data for the page. |
58 */ | 58 */ |
59 setData: function(data) { | 59 set data(data) { |
60 Tile.prototype.setData.apply(this, arguments); | 60 Object.getOwnPropertyDescriptor(Tile.prototype, 'data').set.apply(this, |
61 arguments); | |
61 | 62 |
62 this.formatThumbnail_(data); | 63 this.formatThumbnail_(data); |
63 }, | 64 }, |
Dan Beam
2012/12/05 18:34:05
I'm not totally sure, but you might need a `get da
pedro (no code reviews)
2012/12/05 19:41:34
Thumbnail page is basically a virtual class, and w
| |
64 | 65 |
65 /** | 66 /** |
66 * Formats this tile according to |data|. | 67 * Formats this tile according to |data|. |
67 * @param {Object} data A dictionary of relevant data for the page. | 68 * @param {Object} data A dictionary of relevant data for the page. |
68 * @private | 69 * @private |
69 */ | 70 */ |
70 formatThumbnail_: function(data) { | 71 formatThumbnail_: function(data) { |
71 var title = this.querySelector('.title'); | 72 var title = this.querySelector('.title'); |
72 title.textContent = data.title; | 73 title.textContent = data.title; |
73 title.dir = data.direction; | 74 title.dir = data.direction; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 shouldAcceptDrag: function(e) { | 172 shouldAcceptDrag: function(e) { |
172 return false; | 173 return false; |
173 }, | 174 }, |
174 }; | 175 }; |
175 | 176 |
176 return { | 177 return { |
177 Thumbnail: Thumbnail, | 178 Thumbnail: Thumbnail, |
178 ThumbnailPage: ThumbnailPage, | 179 ThumbnailPage: ThumbnailPage, |
179 }; | 180 }; |
180 }); | 181 }); |
OLD | NEW |