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
cfe3a498
Commit
cfe3a498
authored
Sep 10, 2020
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made MR Popovers bundle load conditionally
parent
d690637a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
app/assets/javascripts/behaviors/markdown/render_gfm.js
app/assets/javascripts/behaviors/markdown/render_gfm.js
+18
-3
No files found.
app/assets/javascripts/behaviors/markdown/render_gfm.js
View file @
cfe3a498
...
...
@@ -5,7 +5,6 @@ import renderMermaid from './render_mermaid';
import
renderMetrics
from
'
./render_metrics
'
;
import
highlightCurrentUser
from
'
./highlight_current_user
'
;
import
initUserPopovers
from
'
../../user_popovers
'
;
import
initMRPopovers
from
'
../../mr_popover
'
;
// Render GitLab flavoured Markdown
//
...
...
@@ -17,9 +16,25 @@ $.fn.renderGFM = function renderGFM() {
renderMermaid
(
this
.
find
(
'
.js-render-mermaid
'
));
highlightCurrentUser
(
this
.
find
(
'
.gfm-project_member
'
).
get
());
initUserPopovers
(
this
.
find
(
'
.js-user-link
'
).
get
());
initMRPopovers
(
this
.
find
(
'
.gfm-merge_request
'
).
get
());
const
mrPopoverElements
=
this
.
find
(
'
.gfm-merge_request
'
).
get
();
if
(
mrPopoverElements
.
length
)
{
import
(
/* webpackChunkName: 'MrPopoverBundle' */
'
../../mr_popover
'
)
.
then
(({
default
:
initMRPopovers
})
=>
{
initMRPopovers
(
mrPopoverElements
);
})
.
catch
(()
=>
{});
}
renderMetrics
(
this
.
find
(
'
.js-render-metrics
'
).
get
());
return
this
;
};
$
(()
=>
$
(
'
body
'
).
renderGFM
());
$
(()
=>
{
window
.
requestIdleCallback
(
()
=>
{
$
(
'
body
'
).
renderGFM
();
},
{
timeout
:
500
},
);
});
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