Skip to content
Snippets Groups Projects
Commit 313c5c3d authored by chris's avatar chris Committed by john
Browse files

notes editor scroll pane minHeight is adjusted on height of dragged area +...

notes editor scroll pane minHeight is adjusted on height of dragged area + attempt to import commentsPane(fragment comments missing)
parent d916c20d
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ import { ...@@ -4,6 +4,8 @@ import {
} from 'substance' } from 'substance'
import ContainerEditor from '../ContainerEditor' import ContainerEditor from '../ContainerEditor'
import Comments from '../panes/Comments/CommentBoxList'
import CommentsProvider from '../panes/Comments/CommentsProvider'
class MiniEditor extends ProseEditor { class MiniEditor extends ProseEditor {
render ($$) { render ($$) {
...@@ -15,7 +17,15 @@ class MiniEditor extends ProseEditor { ...@@ -15,7 +17,15 @@ class MiniEditor extends ProseEditor {
let Overlay = this.componentRegistry.get('overlay') let Overlay = this.componentRegistry.get('overlay')
// TEMP // TEMP
const commentsPane = $$('ul').addClass('sc-comment-pane-list').addClass('sc-comments-pane').append('notes Editor Comments') // const commentsPane = $$('ul').addClass('sc-comment-pane-list').addClass('sc-comments-pane').append('notes Editor Comments')
console.log($$(Comments))
var commentsPane = $$(Comments, {
// TODO -- should probably remove the || {}
// comments: this.props.fragment.comments || {},
fragment: this.props.fragment,
update: this.props.update,
user: this.props.user
}).addClass('sc-comments-pane')
const editorWithComments = $$(SplitPane, { sizeA: '100%', splitType: 'vertical' }) const editorWithComments = $$(SplitPane, { sizeA: '100%', splitType: 'vertical' })
.append( .append(
...@@ -28,7 +38,7 @@ class MiniEditor extends ProseEditor { ...@@ -28,7 +38,7 @@ class MiniEditor extends ProseEditor {
scrollbarPosition: 'right' scrollbarPosition: 'right'
}) })
.append(editorWithComments, $$(Overlay)) .append(editorWithComments, $$(Overlay))
.attr('id', 'content-panel') .attr('id', 'mini-editor-content-panel')
.ref('miniEditorContentPanel') .ref('miniEditorContentPanel')
el.append( el.append(
...@@ -56,6 +66,30 @@ class MiniEditor extends ProseEditor { ...@@ -56,6 +66,30 @@ class MiniEditor extends ProseEditor {
spellcheck: 'native' spellcheck: 'native'
}).ref('mini_body') }).ref('mini_body')
} }
getChildContext () {
const oldContext = super.getChildContext()
const doc = this.doc
// comments provider
const commentsProvider = new CommentsProvider(doc, {
commandManager: this.commandManager,
// comments: this.props.fragment.comments,
containerId: this.props.containerId,
controller: this,
editorSession: this.editorSession,
fragment: this.props.fragment,
surfaceManager: this.surfaceManager,
toggleCommentsArea: this.toggleCommentsArea,
update: this.props.update
})
// attach all to context
return {
...oldContext,
commentsProvider
}
}
} }
export default MiniEditor export default MiniEditor
...@@ -14,7 +14,7 @@ $background: #fff; ...@@ -14,7 +14,7 @@ $background: #fff;
.se-scrollable { .se-scrollable {
margin-top: 0; margin-top: 0;
min-height: 700px; min-height: 95px;
background: $background; background: $background;
.se-content { .se-content {
......
...@@ -23,7 +23,10 @@ class Notes extends Component { ...@@ -23,7 +23,10 @@ class Notes extends Component {
} }
resize (e) { resize (e) {
this.el.el.style.height = (this.el.el.offsetHeight + this.el.el.offsetTop - e.clientY) + 'px' const height = (this.el.el.offsetHeight + this.el.el.offsetTop - e.clientY)
const scrollPane = document.getElementsByClassName('se-scrollable')
scrollPane[1].style.minHeight = height - 40 + 'px'
this.el.el.style.height = height + 'px'
} }
stopResize (e) { stopResize (e) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment