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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
0b7e67ad
Commit
0b7e67ad
authored
Aug 14, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix note preview link, and hide preview and errors after posting a comment
parent
6ebd360c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+1
-1
app/views/notes/_create_common.js.haml
app/views/notes/_create_common.js.haml
+3
-1
No files found.
app/assets/javascripts/application.js
View file @
0b7e67ad
...
@@ -74,7 +74,7 @@ $(document).ready(function(){
...
@@ -74,7 +74,7 @@ $(document).ready(function(){
* Note markdown preview
* Note markdown preview
*
*
*/
*/
$
(
'
#preview-link
'
).
on
(
'
clic
k
'
,
function
(
e
)
{
$
(
document
).
on
(
'
click
'
,
'
#preview-lin
k
'
,
function
(
e
)
{
$
(
'
#preview-note
'
).
text
(
'
Loading...
'
);
$
(
'
#preview-note
'
).
text
(
'
Loading...
'
);
var
previewLinkText
=
(
$
(
this
).
text
()
==
'
Preview
'
?
'
Edit
'
:
'
Preview
'
);
var
previewLinkText
=
(
$
(
this
).
text
()
==
'
Preview
'
?
'
Edit
'
:
'
Preview
'
);
...
...
app/views/notes/_create_common.js.haml
View file @
0b7e67ad
-
if
note
.
valid?
-
if
note
.
valid?
:plain
:plain
$("#new_note .error
s
").remove();
$("#new_note .error").remove();
$('#new_note textarea').val("");
$('#new_note textarea').val("");
$('#preview-link').text('Preview');
$('#preview-note').hide(); $('#note_note').show();
NoteList.prepend(
#{
note
.
id
}
, "
#{
escape_javascript
(
render
partial:
"notes/show"
,
locals:
{
note:
note
})
}
");
NoteList.prepend(
#{
note
.
id
}
, "
#{
escape_javascript
(
render
partial:
"notes/show"
,
locals:
{
note:
note
})
}
");
-
else
-
else
:plain
:plain
...
...
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