Skip to content

Commit

Permalink
BlogPage, LandingPage: Added temporary workaround for dropcap issue a…
Browse files Browse the repository at this point in the history
  • Loading branch information
umamialex committed Jun 20, 2016
1 parent cd5d689 commit d47d5a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 6 additions & 5 deletions frontend/Page/BlogPage/BlogPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ class BlogPage extends React.Component {
}

applyDropCap() {
const dropcap = this.refs.dropcap

log('Applying dropcap.')
window.Dropcap.layout(
document.querySelectorAll('.blog-page-dropcap')
, 3
)

dropcap.dcapjsStrut = null
window.Dropcap.layout(dropcap, 3)
}

componentDidMount() {
Expand Down Expand Up @@ -88,7 +89,7 @@ class BlogPage extends React.Component {
{formattedDate} | {readTime} minute read
</p>
<hr/>
<span className='blog-page-dropcap'>{dropcap}</span>
<span className='blog-page-dropcap' ref='dropcap'>{dropcap}</span>
<ReactMarkdown
className='blog-page-body'
renderers={{
Expand Down
9 changes: 5 additions & 4 deletions frontend/Page/LandingPage/LandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class LandingPage extends React.Component {

applyDropCap() {
log('Applying dropcap.')
window.Dropcap.layout(
document.querySelectorAll('.blog-page-dropcap')
, 3
)

const dropcaps = document.querySelectorAll('.blog-page-dropcap')
_.forEach(dropcaps, (dropcap) => {dropcap.dcapjsStrut=null})

window.Dropcap.layout(dropcaps, 3)
}

blogMapper(blog, index) {
Expand Down

0 comments on commit d47d5a2

Please sign in to comment.