Skip to content

Instantly share code, notes, and snippets.

@brunocarvalhodearaujo
Created December 1, 2016 11:31
Show Gist options
  • Save brunocarvalhodearaujo/706dd8e2391f61075d49d33798bbb8bf to your computer and use it in GitHub Desktop.
Save brunocarvalhodearaujo/706dd8e2391f61075d49d33798bbb8bf to your computer and use it in GitHub Desktop.
import preact, { h, render, Component } from 'preact'
class Page extends Component {
componentDidMount() {
$('.btn').draggable({ iframeFix: true, iframeScroll: true })
$('.render').on('load', () => {
$('.render').contents().find('[wf-droppable]').droppable({
over: ({ target, toElement }) => $(target).css({ border: '2px solid #000000' }),
out: ({ target, toElement }) => $(target).css({ border: 'none' }),
drop: ({ target, toElement }) => console.log(target, toElement)
})
})
}
render({ template }) {
return <iframe elevation="true" className="render" src={template}/>
}
}
render((
<div className="container-fluid">
<div class="btn btn-default" style={{ 'z-index': '3000' }}>
exemplo
</div>
<Page template="blank.html" />
</div>
), document.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment