зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
b6a32b06ae
Коммит
4f1ce4d026
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче