mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
addTag search
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
|
||||
let ReactDOM = require('react-dom')
|
||||
var ace = window.ace
|
||||
|
||||
module.exports = React.createClass({
|
||||
@@ -16,7 +16,7 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
componentDidMount: function () {
|
||||
var el = React.findDOMNode(this.refs.target)
|
||||
var el = ReactDOM.findDOMNode(this.refs.target)
|
||||
var editor = ace.edit(el)
|
||||
editor.$blockScrolling = Infinity
|
||||
editor.setValue(this.props.code)
|
||||
|
||||
20
lib/components/TagLink.js
Normal file
20
lib/components/TagLink.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import store from '../store'
|
||||
import { setTagFilter } from '../actions'
|
||||
|
||||
export default class TagLink extends React.Component {
|
||||
handleClick (e) {
|
||||
store.dispatch(setTagFilter(this.props.tag.name))
|
||||
}
|
||||
render () {
|
||||
return (
|
||||
<a onClick={e => this.handleClick(e)}>{this.props.tag.name}</a>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
TagLink.propTypes = {
|
||||
tag: PropTypes.shape({
|
||||
name: PropTypes.string
|
||||
})
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export default class CreateNewFolder extends React.Component {
|
||||
|
||||
api.createFolder(input)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
console.log(res.body)
|
||||
close()
|
||||
})
|
||||
.catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user