Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5b0e232c
Commit
5b0e232c
authored
Sep 14, 2020
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the repainting problem on the issue page
parent
4d8bc1ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
app/assets/javascripts/issue_show/stores/index.js
app/assets/javascripts/issue_show/stores/index.js
+3
-2
app/assets/javascripts/issue_show/utils/parse_data.js
app/assets/javascripts/issue_show/utils/parse_data.js
+7
-0
No files found.
app/assets/javascripts/issue_show/stores/index.js
View file @
5b0e232c
import
{
sanitize
}
from
'
dompurify
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
updateDescription
from
'
../utils/update_description
'
;
...
...
@@ -27,8 +28,8 @@ export default class Store {
const
details
=
descriptionSection
!=
null
&&
descriptionSection
.
getElementsByTagName
(
'
details
'
);
this
.
state
.
descriptionHtml
=
updateDescription
(
data
.
description
,
details
);
this
.
state
.
titleHtml
=
data
.
title
;
this
.
state
.
descriptionHtml
=
updateDescription
(
sanitize
(
data
.
description
)
,
details
);
this
.
state
.
titleHtml
=
sanitize
(
data
.
title
)
;
this
.
state
.
lock_version
=
data
.
lock_version
;
}
...
...
app/assets/javascripts/issue_show/utils/parse_data.js
View file @
5b0e232c
import
{
sanitize
}
from
'
dompurify
'
;
// We currently load + parse the data from the issue app and related merge request
let
cachedParsedData
;
export
const
parseIssuableData
=
()
=>
{
try
{
if
(
cachedParsedData
)
return
cachedParsedData
;
const
initialDataEl
=
document
.
getElementById
(
'
js-issuable-app-initial-data
'
);
const
parsedData
=
JSON
.
parse
(
initialDataEl
.
textContent
.
replace
(
/"/g
,
'
"
'
));
...
...
@@ -9,6 +14,8 @@ export const parseIssuableData = () => {
parsedData
.
initialTitleHtml
=
sanitize
(
parsedData
.
initialTitleHtml
);
parsedData
.
initialDescriptionHtml
=
sanitize
(
parsedData
.
initialDescriptionHtml
);
cachedParsedData
=
parsedData
;
return
parsedData
;
}
catch
(
e
)
{
console
.
error
(
e
);
// eslint-disable-line no-console
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment