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

Side by Side Diff: chrome/browser/resources/local_ntp/most_visited_thumbnail.js

Issue 23619019: Set position: absolute on NTP thumbnails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed comment wording Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 5
6 /** 6 /**
7 * @fileoverview Rendering for iframed most visited thumbnails. 7 * @fileoverview Rendering for iframed most visited thumbnails.
8 */ 8 */
9 9
10 window.addEventListener('DOMContentLoaded', function() { 10 window.addEventListener('DOMContentLoaded', function() {
(...skipping 12 matching lines...) Expand all
23 document.body.appendChild(link); 23 document.body.appendChild(link);
24 }; 24 };
25 function createAndAppendThumbnail(isVisible) { 25 function createAndAppendThumbnail(isVisible) {
26 var image = new Image(); 26 var image = new Image();
27 image.onload = function() { 27 image.onload = function() {
28 var shadow = document.createElement('span'); 28 var shadow = document.createElement('span');
29 shadow.classList.add('shadow'); 29 shadow.classList.add('shadow');
30 var link = createMostVisitedLink(params, data.url, data.title); 30 var link = createMostVisitedLink(params, data.url, data.title);
31 link.appendChild(shadow); 31 link.appendChild(shadow);
32 link.appendChild(image); 32 link.appendChild(image);
33 // We add 'position: absolute' in anticipation that there could be more
34 // than one thumbnail. This will superpose the elements.
35 link.style.position = 'absolute';
33 document.body.appendChild(link); 36 document.body.appendChild(link);
34 }; 37 };
35 if (!isVisible) { 38 if (!isVisible) {
36 image.style.visibility = 'hidden'; 39 image.style.visibility = 'hidden';
37 } 40 }
38 return image; 41 return image;
39 } 42 }
40 43
41 if (data.thumbnailUrl) { 44 if (data.thumbnailUrl) {
42 var image = createAndAppendThumbnail(true); 45 var image = createAndAppendThumbnail(true);
(...skipping 16 matching lines...) Expand all
59 } else { 62 } else {
60 image.onerror = showDomainElement; 63 image.onerror = showDomainElement;
61 } 64 }
62 image.src = data.thumbnailUrl; 65 image.src = data.thumbnailUrl;
63 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_THUMBNAIL_ATTEMPT); 66 logEvent(NTP_LOGGING_EVENT_TYPE.NTP_THUMBNAIL_ATTEMPT);
64 } else { 67 } else {
65 showDomainElement(); 68 showDomainElement();
66 } 69 }
67 }); 70 });
68 }); 71 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698