Support images

This commit is contained in:
Rico Sta. Cruz 2017-10-11 09:30:46 +08:00
parent 0d71152197
commit 1e510e9e0a
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
3 changed files with 19 additions and 3 deletions

View File

@ -2,14 +2,24 @@
import Isotope from 'isotope-layout/dist/isotope.pkgd.js'
import onmount from 'onmount'
import on from 'dom101/on'
import qsa from 'dom101/query-selector-all'
/*
* Behavior: Isotope
*/
onmount('[data-js-h3-section-list]', function () {
new Isotope(this, {
const iso = new Isotope(this, {
itemSelector: '.h3-section',
transitionDuration: 0
})
const images = qsa('img', this)
images.forEach(image => {
on(image, 'load', () => {
iso.layout()
})
})
})

View File

@ -2,6 +2,12 @@
* Crosslink (eg, phoenix.md)
*/
.MarkdownBody.MarkdownBody {
img {
max-width: 100%;
}
}
.MarkdownBody.MarkdownBody p.-crosslink {
& > a {
display: block;

File diff suppressed because one or more lines are too long