Bug 975210 - Augment Site._render logic to allow for Sponsored Tiles images & text [r=adw]

For type={affiliate,organic,sponsored} tiles, show the appropriate imageURISpec instead of thumbnail.
This commit is contained in:
Maxim Zhilyaev 2014-03-31 01:51:23 -07:00
Родитель b6a32b06ae
Коммит 4f1ce4d026
4 изменённых файлов: 26 добавлений и 3 удалений

Просмотреть файл

@ -144,17 +144,19 @@ Site.prototype = {
* existing thumbnail and the page allows background captures.
*/
captureIfMissing: function Site_captureIfMissing() {
if (gPage.allowBackgroundCaptures)
if (gPage.allowBackgroundCaptures && !this.link.imageURISpec) {
BackgroundPageThumbs.captureIfMissing(this.url);
}
},
/**
* Refreshes the thumbnail for the site.
*/
refreshThumbnail: function Site_refreshThumbnail() {
let thumbnailURL = PageThumbs.getThumbnailURL(this.url);
let thumbnail = this._querySelector(".newtab-thumbnail");
thumbnail.style.backgroundImage = "url(" + thumbnailURL + ")";
thumbnail.style.backgroundColor = this.link.bgColor;
let uri = this.link.imageURISpec || PageThumbs.getThumbnailURL(this.url);
thumbnail.style.backgroundImage = "url(" + uri + ")";
},
/**

Просмотреть файл

@ -117,6 +117,13 @@
background-size: cover;
}
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-size: auto;
}
/* TITLES */
.newtab-title {
color: #525c66;

Просмотреть файл

@ -121,6 +121,13 @@
background-size: cover;
}
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-size: auto;
}
/* TITLES */
.newtab-title {
color: #525c66;

Просмотреть файл

@ -120,6 +120,13 @@
background-size: cover;
}
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-size: auto;
}
/* TITLES */
.newtab-title {
color: #525c66;