Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yannis Barlas
editoria
Commits
2af7c829
Commit
2af7c829
authored
8 years ago
by
chris
Committed by
Yannis Barlas
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
you can write in editor once again
parent
938074e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/SimpleEditor/ContainerEditor.js
+16
-18
16 additions, 18 deletions
app/components/SimpleEditor/ContainerEditor.js
app/components/SimpleEditor/Editor.js
+2
-2
2 additions, 2 deletions
app/components/SimpleEditor/Editor.js
with
18 additions
and
20 deletions
app/components/SimpleEditor/ContainerEditor.js
+
16
−
18
View file @
2af7c829
...
@@ -4,14 +4,12 @@ import {
...
@@ -4,14 +4,12 @@ import {
// deleteCharacter,
// deleteCharacter,
// deleteSelection,
// deleteSelection,
keys
as
keyboardKeys
,
keys
as
keyboardKeys
,
Surface
,
uuid
uuid
}
from
'
substance
'
}
from
'
substance
'
class
ContainerEditor
extends
SubstanceContainerEditor
{
class
ContainerEditor
extends
SubstanceContainerEditor
{
render
(
$$
)
{
render
(
$$
)
{
// TODO -- call with super
let
el
=
super
.
render
(
$$
)
var
el
=
Surface
.
prototype
.
render
.
call
(
this
,
$$
)
var
doc
=
this
.
getDocument
()
var
doc
=
this
.
getDocument
()
var
containerId
=
this
.
getContainerId
()
var
containerId
=
this
.
getContainerId
()
...
@@ -29,9 +27,9 @@ class ContainerEditor extends SubstanceContainerEditor {
...
@@ -29,9 +27,9 @@ class ContainerEditor extends SubstanceContainerEditor {
// if it IS empty, handle in didMount
// if it IS empty, handle in didMount
if
(
!
this
.
isEmpty
())
{
if
(
!
this
.
isEmpty
())
{
containerNode
.
getNodes
().
forEach
(
function
(
node
)
{
//
containerNode.getNodes().forEach(function (node) {
el
.
append
(
this
.
_renderNode
(
$$
,
node
).
ref
(
node
.
id
))
//
el.append(this._renderNode($$, node).ref(node.id))
}.
bind
(
this
))
//
}.bind(this))
}
}
// open for editing
// open for editing
...
@@ -44,21 +42,21 @@ class ContainerEditor extends SubstanceContainerEditor {
...
@@ -44,21 +42,21 @@ class ContainerEditor extends SubstanceContainerEditor {
return
el
return
el
}
}
//
didMount
()
{
didMount
()
{
super
.
didMount
()
super
.
didMount
()
if
(
this
.
isEmpty
())
this
.
createText
()
if
(
this
.
isEmpty
())
this
.
createText
()
this
.
focus
()
this
.
focus
()
// TODO notworking
if
(
this
.
isReadOnlyMode
())
{
//
if (this.isReadOnlyMode()) {
const
documentSession
=
this
.
getDocumentSession
()
//
const documentSession = this.getDocumentSession()
documentSession
.
on
(
'
didUpdate
'
,
this
.
disableToolbar
,
this
)
//
documentSession.on('didUpdate', this.disableToolbar, this)
//
this
.
addTargetToLinks
()
//
this.addTargetToLinks()
}
//
}
}
}
//
onTextInput
(
event
)
{
onTextInput
(
event
)
{
if
(
!
this
.
props
.
trackChanges
)
return
super
.
onTextInput
(
event
)
if
(
!
this
.
props
.
trackChanges
)
return
super
.
onTextInput
(
event
)
...
@@ -159,7 +157,7 @@ class ContainerEditor extends SubstanceContainerEditor {
...
@@ -159,7 +157,7 @@ class ContainerEditor extends SubstanceContainerEditor {
createText
()
{
createText
()
{
var
newSel
var
newSel
this
.
transaction
(
function
(
tx
)
{
this
.
editorSession
.
transaction
(
function
(
tx
)
{
var
container
=
tx
.
get
(
this
.
props
.
containerId
)
var
container
=
tx
.
get
(
this
.
props
.
containerId
)
var
textType
=
tx
.
getSchema
().
getDefaultTextType
()
var
textType
=
tx
.
getSchema
().
getDefaultTextType
()
...
@@ -180,7 +178,7 @@ class ContainerEditor extends SubstanceContainerEditor {
...
@@ -180,7 +178,7 @@ class ContainerEditor extends SubstanceContainerEditor {
}.
bind
(
this
))
}.
bind
(
this
))
this
.
rerender
()
this
.
rerender
()
this
.
setSelection
(
newSel
)
this
.
editorSession
.
setSelection
(
newSel
)
}
}
// only runs if editor is in read-only mode
// only runs if editor is in read-only mode
...
...
This diff is collapsed.
Click to expand it.
app/components/SimpleEditor/Editor.js
+
2
−
2
View file @
2af7c829
...
@@ -41,8 +41,8 @@ class Editor extends ProseEditor {
...
@@ -41,8 +41,8 @@ class Editor extends ProseEditor {
willUpdateState
()
{}
willUpdateState
()
{}
didMount
()
{
didMount
()
{
this
.
documentSession
.
on
(
'
didUpdate
'
,
this
.
documentSessionUpdated
,
this
)
//
this.documentSession.on('didUpdate', this.documentSessionUpdated, this)
this
.
documentSession
.
on
(
'
fileUploadTrigger
'
,
this
.
handleUpload
,
this
)
//
this.documentSession.on('fileUploadTrigger', this.handleUpload, this)
this
.
extendState
({
editorReady
:
true
})
this
.
extendState
({
editorReady
:
true
})
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment