dev_forum
hjm 6 years ago
parent 29d34aaddf
commit 6cf1e935fa

@ -318,16 +318,20 @@ class BoardsNew extends Component{
label="标题" label="标题"
className="topicTitle notRequired" className="topicTitle notRequired"
> >
{getFieldDecorator('sticky', { { isAdmin &&
valuePropName: 'checked', <React.Fragment>
})( {getFieldDecorator('sticky', {
<Checkbox style={{ right: '0px', valuePropName: 'checked',
top: '-50px', })(
position: 'absolute' isAdmin && <Checkbox style={{ right: '0px',
}}>置顶</Checkbox> top: '-50px',
)} position: 'absolute'
{/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */} }}>置顶</Checkbox>
<span style={{ "padding-left": 0, "padding-right": 0 }}></span> )}
{/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */}
<span style={{ "padding-left": 0, "padding-right": 0 }}></span>
</React.Fragment>
}
{getFieldDecorator('subject', { {getFieldDecorator('subject', {
rules: [{ rules: [{
required: true, message: '请输入标题', required: true, message: '请输入标题',

@ -416,7 +416,7 @@ class TopicDetail extends Component {
const user = this._getUser(); const user = this._getUser();
this.setState({ this.setState({
comments: addNewComment(comments, _id, content, user, this) comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
}) })
const newMemo2 = Object.assign({}, this.state.memo); const newMemo2 = Object.assign({}, this.state.memo);
newMemo2.total_replies_count = newMemo2.total_replies_count + 1; newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
@ -540,6 +540,10 @@ class TopicDetail extends Component {
padding-bottom: 20px; padding-bottom: 20px;
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
.course-message.topicDetail .panel-comment_item .comment_orig_content {
width: 1072px;
}
`}</style> `}</style>
<CBreadcrumb className={'independent'} items={[ <CBreadcrumb className={'independent'} items={[
{ to: `/courses/${courseId}`, name: this.props.coursedata.name}, { to: `/courses/${courseId}`, name: this.props.coursedata.name},
@ -701,11 +705,13 @@ class TopicDetail extends Component {
</div>} */} </div>} */}
</div> </div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore"> <div className="memoMore" style={{'margin-top': '20px'}}>
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> { total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
}
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> } </div>
</div> </div>
</div> </div>

@ -32,6 +32,7 @@ class MemoDetailMDEditor extends Component {
} }
initMDEditor = () => { initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可 // 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
@ -42,7 +43,7 @@ class MemoDetailMDEditor extends Component {
setTimeout(() => { setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => { var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus() commentMDEditor.focus()
this.isMDInited = true
this.initDrag() this.initDrag()
commentMDEditor.cm.on("change", (_cm, changeObj) => { commentMDEditor.cm.on("change", (_cm, changeObj) => {
@ -114,7 +115,13 @@ class MemoDetailMDEditor extends Component {
} }
onMockInputClick = () => { onMockInputClick = () => {
this.setState({isInited: true}) this.setState({isInited: true})
this.initMDEditor() if (!this.isMDInited) {
this.initMDEditor()
} else {
setTimeout(() => {
this.commentMDEditor.focus()
}, 10)
}
} }
render() { render() {
const { match, history, memo, placeholder, className } = this.props const { match, history, memo, placeholder, className } = this.props

Loading…
Cancel
Save