Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
verona-modules-aspect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
verona-modules-aspect
Commits
c5690274
Commit
c5690274
authored
2 years ago
by
rhenck
Browse files
Options
Downloads
Patches
Plain Diff
Fix TextEditor cloze mode
parent
6439e395
No related branches found
No related tags found
No related merge requests found
Pipeline
#38324
canceled
2 years ago
Stage: install
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/editor/src/app/text-editor/rich-text-editor.component.ts
+6
-5
6 additions, 5 deletions
.../editor/src/app/text-editor/rich-text-editor.component.ts
with
6 additions
and
5 deletions
projects/editor/src/app/text-editor/rich-text-editor.component.ts
+
6
−
5
View file @
c5690274
import
{
import
{
Component
,
EventEmitter
,
Input
,
Output
,
Component
,
EventEmitter
,
Input
,
Output
,
AfterViewInit
,
Injector
AfterViewInit
,
Injector
,
OnInit
}
from
'
@angular/core
'
;
}
from
'
@angular/core
'
;
import
{
Editor
}
from
'
@tiptap/core
'
;
import
{
Editor
}
from
'
@tiptap/core
'
;
import
StarterKit
from
'
@tiptap/starter-kit
'
;
import
StarterKit
from
'
@tiptap/starter-kit
'
;
...
@@ -32,7 +32,7 @@ import TextFieldComponentExtension from './angular-node-views/text-field-compone
...
@@ -32,7 +32,7 @@ import TextFieldComponentExtension from './angular-node-views/text-field-compone
templateUrl
:
'
./rich-text-editor.component.html
'
,
templateUrl
:
'
./rich-text-editor.component.html
'
,
styleUrls
:
[
'
./rich-text-editor.component.css
'
]
styleUrls
:
[
'
./rich-text-editor.component.css
'
]
})
})
export
class
RichTextEditorComponent
implements
AfterViewInit
{
export
class
RichTextEditorComponent
implements
OnInit
,
AfterViewInit
{
@
Input
()
content
!
:
string
|
Record
<
string
,
any
>
;
@
Input
()
content
!
:
string
|
Record
<
string
,
any
>
;
@
Input
()
defaultFontSize
!
:
number
;
@
Input
()
defaultFontSize
!
:
number
;
@
Input
()
clozeMode
:
boolean
=
false
;
@
Input
()
clozeMode
:
boolean
=
false
;
...
@@ -75,16 +75,17 @@ export class RichTextEditorComponent implements AfterViewInit {
...
@@ -75,16 +75,17 @@ export class RichTextEditorComponent implements AfterViewInit {
Blockquote
Blockquote
];
];
editor
:
Editor
;
editor
:
Editor
=
new
Editor
({
extensions
:
this
.
defaultExtensions
})
;
constructor
(
private
injector
:
Injector
)
{
constructor
(
private
injector
:
Injector
)
{
}
ngOnInit
():
void
{
const
activeExtensions
=
this
.
defaultExtensions
;
const
activeExtensions
=
this
.
defaultExtensions
;
if
(
this
.
clozeMode
)
{
if
(
this
.
clozeMode
)
{
activeExtensions
.
push
(
ToggleButtonComponentExtension
(
this
.
injector
));
activeExtensions
.
push
(
ToggleButtonComponentExtension
(
this
.
injector
));
activeExtensions
.
push
(
DropListComponentExtension
(
this
.
injector
));
activeExtensions
.
push
(
DropListComponentExtension
(
this
.
injector
));
activeExtensions
.
push
(
TextFieldComponentExtension
(
this
.
injector
));
activeExtensions
.
push
(
TextFieldComponentExtension
(
this
.
injector
));
}
}
this
.
editor
=
new
Editor
({
extensions
:
activeExtensions
});
this
.
editor
=
new
Editor
({
extensions
:
activeExtensions
});
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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