lib/carte/client/views/card.cjsx in carte-server-0.0.7 vs lib/carte/client/views/card.cjsx in carte-server-0.0.8
- old
+ new
@@ -1,14 +1,14 @@
# @cjsx React.DOM
React = require('react')
Edit = require('./edit')
ModalTrigger = require('react-bootstrap/lib/ModalTrigger')
markdownIt = require('markdown-it')(linkify: true)
+helpers = require('../helpers')
module.exports = React.createClass
displayName: 'Card'
- isSafariOrUiWebView: /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)
componentDidMount: ->
@props.card.on 'change', @forceUpdate.bind(@, null)
@props.card.on 'change', (model)->
console.log 'change', model
@@ -36,11 +36,11 @@
<i className='glyphicon glyphicon-star' style={marginRight:'5px'} />
}
<strong>
{@props.card.get('title')}
</strong>
- <span className='pull-right tools' style={{visibility: if @isSafariOrUiWebView || @state.showTools then 'visible' else 'hidden'}}>
+ <span className='pull-right tools' style={{visibility: if helpers.isMobile() || @state.showTools then 'visible' else 'hidden'}}>
<ModalTrigger modal={<Edit card={@props.card} />}>
<a href="javascript:void(0)">
<i className='glyphicon glyphicon-edit' />
</a>
</ModalTrigger>
@@ -52,10 +52,10 @@
</span>
</div>
<div style={overflow:'hidden',width:'100%',height:'75%',wordWrap:'break-word'}>
<div dangerouslySetInnerHTML={__html: markdownIt.render @props.card.get('content')} />
</div>
- <div style={{visibility: if @isSafariOrUiWebView || @state.showTools then 'visible' else 'hidden'}}>
+ <div style={{visibility: if helpers.isMobile() || @state.showTools then 'visible' else 'hidden'}}>
{
if @props.card.get("tags")
@props.card.get("tags").map (tag)->
<span className="pull-right tools"> <a href={"/#/?tags=" + tag}><i className="glyphicon glyphicon-tag" /> {tag}</a></span>
}