Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Code review 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
Jan-Hendrik Willms
Stud.IP
Commits
a64695bc
Commit
a64695bc
authored
2 years ago
by
Ron Lucke
Committed by
Jan-Hendrik Willms
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix #1749
Closes #1749 Merge request
studip/studip!1547
parent
c6b297e5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/assets/javascripts/lib/wysiwyg.js
+38
-1
38 additions, 1 deletion
resources/assets/javascripts/lib/wysiwyg.js
with
38 additions
and
1 deletion
resources/assets/javascripts/lib/wysiwyg.js
+
38
−
1
View file @
a64695bc
...
@@ -61,6 +61,7 @@ function replaceTextarea(textarea) {
...
@@ -61,6 +61,7 @@ function replaceTextarea(textarea) {
const
$textarea
=
textarea
instanceof
jQuery
?
textarea
:
$
(
textarea
);
const
$textarea
=
textarea
instanceof
jQuery
?
textarea
:
$
(
textarea
);
let
options
=
{};
let
options
=
{};
if
(
$textarea
.
attr
(
'
data-editor
'
))
{
if
(
$textarea
.
attr
(
'
data-editor
'
))
{
const
parsed
=
parseOptions
(
$textarea
.
attr
(
'
data-editor
'
));
const
parsed
=
parseOptions
(
$textarea
.
attr
(
'
data-editor
'
));
...
@@ -124,7 +125,43 @@ function replaceTextarea(textarea) {
...
@@ -124,7 +125,43 @@ function replaceTextarea(textarea) {
.
then
(
emitLoadEvent
);
.
then
(
emitLoadEvent
);
function
createEditor
(
ClassicEditor
)
{
function
createEditor
(
ClassicEditor
)
{
return
ClassicEditor
.
create
(
textarea
,
options
);
return
ClassicEditor
.
create
(
textarea
,
options
).
then
(
editor
=>
{
function
getViewportOffsetTop
()
{
const
topBar
=
document
.
getElementById
(
'
top-bar
'
);
const
responsiveContentbar
=
document
.
getElementById
(
'
responsive-contentbar
'
);
let
top
=
topBar
.
clientHeight
+
topBar
.
clientTop
;
if
(
responsiveContentbar
)
{
top
+=
responsiveContentbar
?.
clientHeight
+
responsiveContentbar
.
clientTop
;
}
return
top
;
}
function
updateOffsetTop
()
{
// This needs to be delayed since some events will fire before
// changing the DOM
setTimeout
(()
=>
{
editor
.
ui
.
viewportOffset
=
{
top
:
getViewportOffsetTop
()};
editor
.
ui
.
update
();
},
50
);
}
// Set initial offset top
updateOffsetTop
();
// Listen to relevant events that may require the sticky panel to be misplaced
STUDIP
.
eventBus
.
on
(
'
toggle-compact-navigation
'
,
updateOffsetTop
);
STUDIP
.
eventBus
.
on
(
'
switch-focus-mode
'
,
updateOffsetTop
);
// Stop listening if editor is destroyed
editor
.
on
(
'
destroy
'
,
()
=>
{
STUDIP
.
eventBus
.
off
(
'
toggle-compact-navigation
'
,
updateOffsetTop
);
STUDIP
.
eventBus
.
off
(
'
switch-focus-mode
'
,
updateOffsetTop
);
});
return
editor
;
});
}
}
function
setEditorInstance
(
ckeditor
)
{
function
setEditorInstance
(
ckeditor
)
{
...
...
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