Bug 927938 - Remove extra refresh of TopSites tile backgrounds. r=rsilveira

--HG--
extra : rebase_source : 29efd6e3c8385d4c3e72d55d4a5b109b474ce1c7
This commit is contained in:
Sam Foster 2013-10-17 15:47:22 -07:00
parent 4572d7ffb6
commit 2854eb946b
2 changed files with 7 additions and 4 deletions

View File

@ -167,9 +167,12 @@ TopSitesView.prototype = Util.extend(Object.create(View.prototype), {
let filepath = PageThumbsStorage.getFilePathForURL(aSite.url);
if (yield OS.File.exists(filepath)) {
aSite.backgroundImage = 'url("'+PageThumbs.getThumbnailURL(aSite.url)+'")';
if ('backgroundImage' in aTileNode) {
// use the setter when available to update the backgroundImage value
if ('backgroundImage' in aTileNode &&
aTileNode.backgroundImage != aSite.backgroundImage) {
aTileNode.backgroundImage = aSite.backgroundImage;
} else {
// just update the attribute for when the node gets the binding applied
aTileNode.setAttribute("customImage", aSite.backgroundImage);
}
}

View File

@ -87,9 +87,9 @@ View.prototype = {
// get the rgb value that represents this color at given opacity over a white matte
let tintColor = ColorUtils.addRgbColors(matteColor, ColorUtils.createDecimalColorWord(r,g,b,alpha));
aItem.setAttribute("tintColor", ColorUtils.convertDecimalToRgbColor(tintColor));
if (aItem.refresh) {
aItem.refresh();
// when bound, use the setter to propogate the color change through the tile
if ('color' in aItem) {
aItem.color = background;
}
};
let failureAction = function() {};