dev_forum
hjm 6 years ago
parent 29d34aaddf
commit 6cf1e935fa

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

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

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

Loading…
Cancel
Save