Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
fix(content): #632 Bug 1269777 - Google search string from context me…
Browse files Browse the repository at this point in the history
…nu wrongly searches
  • Loading branch information
sarracini committed May 24, 2016
1 parent d19be4d commit 02f5f70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content-src/components/SiteIcon/SiteIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SiteIcon = React.createClass({
<div ref="border" hidden={!showBackground || !showBorder} className="inner-border" />
<div className="site-icon-wrapper">
<img ref="favicon" width={faviconSize} height={faviconSize} className="site-icon-favicon" hidden={showFallback} src={site.favicon} />
<span ref="fallback" className="site-icon-fallback" style={fallbackStyle} hidden={!showFallback}>{site.firstLetter}</span>
<span ref="fallback" className="site-icon-fallback" style={fallbackStyle} hidden={!showFallback} data-first-letter={site.firstLetter} />
</div>
<div ref="title" hidden={!showTitle} className="site-icon-title">{site.label}</div>
</div>);
Expand Down
4 changes: 4 additions & 0 deletions content-src/components/SiteIcon/SiteIcon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
.site-icon-fallback {
text-transform: uppercase;
opacity: 0.75;

&::after {
content: attr(data-first-letter);
}
}

.site-icon-title {
Expand Down
5 changes: 4 additions & 1 deletion content-test/components/SiteIcon.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ describe("SiteIcon", () => {
assert.equal(instance.refs.background.style.backgroundColor, "rgb(0, 0, 0)");
});
it("should use the first letter of the host name", () => {
assert.equal(instance.refs.fallback.innerHTML, "f");
assert.equal(instance.refs.fallback.dataset.firstLetter, "f");
});
it("should not affect the content text", () => {
assert.equal(instance.refs.fallback.innerHTML, "");
});
});
});

0 comments on commit 02f5f70

Please sign in to comment.