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
9addd980
Commit
9addd980
authored
Dec 18, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide & show toolbar on MR page
parent
47eaadec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/assets/javascripts/preview_markdown.js
app/assets/javascripts/preview_markdown.js
+3
-3
app/views/projects/_md_preview.html.haml
app/views/projects/_md_preview.html.haml
+1
-1
No files found.
app/assets/javascripts/preview_markdown.js
View file @
9addd980
...
...
@@ -117,12 +117,10 @@
}());
markdownPreview
=
new
window
.
MarkdownPreview
();
previewButtonSelector
=
'
.js-md-preview-button
'
;
writeButtonSelector
=
'
.js-md-write-button
'
;
lastTextareaPreviewed
=
null
;
const
markdownToolbar
=
$
(
'
.md-header-toolbar
'
);
$
.
fn
.
setupMarkdownPreview
=
function
()
{
var
$form
=
$
(
this
);
...
...
@@ -146,6 +144,7 @@
// toggle content
$form
.
find
(
'
.md-write-holder
'
).
hide
();
$form
.
find
(
'
.md-preview-holder
'
).
show
();
markdownToolbar
.
removeClass
(
'
active
'
);
markdownPreview
.
showPreview
(
$form
);
});
...
...
@@ -167,6 +166,7 @@
$form
.
find
(
'
.md-write-holder
'
).
show
();
$form
.
find
(
'
textarea.markdown-area
'
).
focus
();
$form
.
find
(
'
.md-preview-holder
'
).
hide
();
markdownToolbar
.
addClass
(
'
active
'
);
markdownPreview
.
hideReferencedCommands
(
$form
);
});
...
...
app/views/projects/_md_preview.html.haml
View file @
9addd980
...
...
@@ -17,7 +17,7 @@
%a
.js-md-preview-button
{
href:
"#md-preview-holder"
,
tabindex:
-
1
}
Preview
%li
.md-header-toolbar
%li
.md-header-toolbar
.active
=
markdown_toolbar_button
({
icon:
"bold"
,
data:
{
"md-tag"
=>
"**"
},
title:
"Add bold text"
})
=
markdown_toolbar_button
({
icon:
"italic"
,
data:
{
"md-tag"
=>
"*"
},
title:
"Add italic text"
})
=
markdown_toolbar_button
({
icon:
"quote"
,
data:
{
"md-tag"
=>
"> "
,
"md-prepend"
=>
true
},
title:
"Insert a quote"
})
...
...
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