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
Jérome Perrin
gitlab-ce
Commits
4ed82788
Commit
4ed82788
authored
Dec 03, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bunch of smaller glitches.
parent
7978f8dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
112 deletions
+83
-112
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+27
-45
app/assets/stylesheets/sections/notes.scss
app/assets/stylesheets/sections/notes.scss
+53
-64
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+1
-1
app/views/notes/_form.html.haml
app/views/notes/_form.html.haml
+2
-2
No files found.
app/assets/javascripts/notes.js
View file @
4ed82788
...
...
@@ -58,12 +58,6 @@ var NoteList = {
"
.js-close-discussion-note-form
"
,
NoteList
.
removeDiscussionNoteForm
);
// do some specific housekeeping when removing a diff or discussion note
$
(
document
).
on
(
"
click
"
,
"
.diff_file .js-note-delete,
"
+
"
.discussion .js-note-delete
"
,
NoteList
.
removeDiscussionNote
);
// remove a note (in general)
$
(
document
).
on
(
"
click
"
,
"
.js-note-delete
"
,
...
...
@@ -96,9 +90,6 @@ var NoteList = {
previewContainer
.
removeClass
(
"
on
"
);
}
form
.
find
(
"
.js-note-text
"
).
val
(
""
).
trigger
(
"
input
"
);
// re-enable submit button
form
.
find
(
"
.js-comment-button
"
).
enable
();
},
/**
...
...
@@ -144,8 +135,6 @@ var NoteList = {
var
preview
=
form
.
find
(
'
.js-note-preview
'
);
var
noteText
=
form
.
find
(
'
.js-note-text
'
).
val
();
console
.
log
(
"
preview
"
,
noteText
);
if
(
noteText
.
trim
().
length
===
0
)
{
preview
.
text
(
'
Nothing to preview.
'
);
}
else
{
...
...
@@ -157,36 +146,13 @@ var NoteList = {
}
},
/**
* Called in response to deleting a note on a diff line.
*
* Removes the actual note from view.
* Removes the whole notes row if the last note for that line is being removed.
*
* Note: must be called before removeNote()
*/
removeDiscussionNote
:
function
()
{
var
notes
=
$
(
this
).
closest
(
"
.notes
"
);
// check if this is the last note for this line
if
(
notes
.
find
(
"
.note
"
).
length
===
1
)
{
// for discussions
notes
.
closest
(
"
.discussion
"
).
remove
();
// for diff lines
notes
.
closest
(
"
tr
"
).
remove
();
}
},
/**
* Called in response to "cancel" on a diff note form.
*
* Shows the reply button again.
* Removes the form and if necessary it's temporary row.
*/
removeDiscussionNoteForm
:
function
(
e
)
{
e
.
preventDefault
();
removeDiscussionNoteForm
:
function
()
{
var
form
=
$
(
this
).
closest
(
"
form
"
);
var
row
=
form
.
closest
(
"
tr
"
);
...
...
@@ -206,9 +172,22 @@ var NoteList = {
* Called in response to deleting a note of any kind.
*
* Removes the actual note from view.
* Removes the whole discussion if the last note is being removed.
*/
removeNote
:
function
()
{
$
(
this
).
closest
(
"
.note
"
).
remove
();
var
note
=
$
(
this
).
closest
(
"
.note
"
);
var
notes
=
note
.
closest
(
"
.notes
"
);
// check if this is the last note for this line
if
(
notes
.
find
(
"
.note
"
).
length
===
1
)
{
// for discussions
notes
.
closest
(
"
.discussion
"
).
remove
();
// for diff lines
notes
.
closest
(
"
tr
"
).
remove
();
}
note
.
remove
();
NoteList
.
updateVotes
();
},
...
...
@@ -274,6 +253,7 @@ var NoteList = {
NoteList
.
setupNoteForm
(
form
);
form
.
find
(
"
.js-note-text
"
).
focus
();
},
/**
...
...
@@ -312,16 +292,18 @@ var NoteList = {
setupNoteForm
:
function
(
form
)
{
disableButtonIfEmptyField
(
form
.
find
(
"
.js-note-text
"
),
form
.
find
(
"
.js-comment-button
"
));
form
.
removeClass
(
"
js-new-note-form
"
);
// setup preview buttons
$
(
"
.js-note-edit-button, .js-note-preview-button
"
).
tooltip
({
placement
:
'
left
'
});
form
.
find
(
"
.js-note-edit-button, .js-note-preview-button
"
)
.
tooltip
({
placement
:
'
left
'
});
previewButton
=
$
(
"
.js-note-preview-button
"
);
previewButton
.
hide
();
previewButton
=
form
.
find
(
"
.js-note-preview-button
"
);
form
.
find
(
"
.js-note-text
"
).
on
(
"
input
"
,
function
()
{
if
(
$
(
this
).
val
().
trim
()
!==
""
)
{
previewButton
.
fadeIn
(
);
previewButton
.
removeClass
(
"
turn-off
"
).
addClass
(
"
turn-on
"
);
}
else
{
previewButton
.
fadeOut
(
);
previewButton
.
removeClass
(
"
turn-on
"
).
addClass
(
"
turn-off
"
);
}
});
...
...
@@ -344,8 +326,8 @@ var NoteList = {
$
.
ajax
({
url
:
NoteList
.
notes_path
,
data
:
NoteList
.
target_params
,
complete
:
function
(){
$
(
'
.
notes-status
'
).
removeClass
(
"
loading
"
)},
beforeSend
:
function
()
{
$
(
'
.
notes-status
'
).
addClass
(
"
loading
"
)
},
complete
:
function
(){
$
(
'
.
js-notes-busy
'
).
removeClass
(
"
loading
"
)},
beforeSend
:
function
()
{
$
(
'
.
js-notes-busy
'
).
addClass
(
"
loading
"
)
},
dataType
:
"
script
"
});
},
...
...
@@ -404,8 +386,8 @@ var NoteList = {
$
.
ajax
({
url
:
NoteList
.
notes_path
,
data
:
NoteList
.
target_params
+
"
&loading_more=1&
"
+
(
NoteList
.
reversed
?
"
before_id
"
:
"
after_id
"
)
+
"
=
"
+
NoteList
.
bottom_id
,
complete
:
function
(){
$
(
'
.
notes-status
'
).
removeClass
(
"
loading
"
)},
beforeSend
:
function
()
{
$
(
'
.
notes-status
'
).
addClass
(
"
loading
"
)
},
complete
:
function
(){
$
(
'
.
js-notes-busy
'
).
removeClass
(
"
loading
"
)},
beforeSend
:
function
()
{
$
(
'
.
js-notes-busy
'
).
addClass
(
"
loading
"
)
},
dataType
:
"
script
"
});
},
...
...
app/assets/stylesheets/sections/notes.scss
View file @
4ed82788
...
...
@@ -135,9 +135,12 @@ ul.notes {
}
}
/**
*
Discussion/Note Action
s
*
Actions for Discussions/Note
s
*/
.discussion
,
.note
{
&
.note
:hover
{
...
...
@@ -174,33 +177,12 @@ ul.notes {
top
:
0
;
}
// TODO: start cleaup
.issue_notes
,
.wiki_notes
{
.note_content
{
float
:
left
;
width
:
400px
;
}
}
/* for loading indicator */
.notes-status
{
margin
:
18px
;
}
p
.notify_controls
input
{
margin
:
5px
;
}
p
.notify_controls
span
{
font-weight
:
700
;
}
// TODO: end cleaup
/**
*
l
ine note button on the side of diffs
*
L
ine note button on the side of diffs
*/
.diff_file
tr
.line_holder
{
.add-diff-note
{
background
:
url("diff_note_add.png")
no-repeat
left
0
;
...
...
@@ -231,8 +213,10 @@ p.notify_controls span{
}
}
/**
* Note Form
s
* Note Form
*/
.comment-btn
,
...
...
@@ -257,6 +241,46 @@ p.notify_controls span{
line-height
:
32px
;
padding-right
:
15px
;
}
// TODO: start cleanup
.attachments
{
position
:
relative
;
width
:
350px
;
height
:
50px
;
overflow
:
hidden
;
margin
:
0
0
5px
!
important
;
.input_file
{
.file_name
{
line-height
:
30px
;
width
:
240px
;
height
:
28px
;
overflow
:
hidden
;
}
.file_upload
{
position
:
absolute
;
right
:
14px
;
top
:
7px
;
}
.input-file
{
width
:
260px
;
height
:
41px
;
float
:
right
;
}
}
}
.input-file
{
font
:
500px
monospace
;
opacity
:
0
;
filter
:
alpha
(
opacity
=
0
);
position
:
absolute
;
z-index
:
1
;
top
:
0
;
right
:
0
;
padding
:
0
;
margin
:
0
;
}
// TODO: end cleanup
}
.note_text_and_preview
{
// makes the "absolute" position for links relative to this
...
...
@@ -282,44 +306,9 @@ p.notify_controls span{
width
:
98
.6%
;
}
}
}
// TODO: start cleanup
.attachments
{
position
:
relative
;
width
:
350px
;
height
:
50px
;
overflow
:
hidden
;
margin
:
0
0
5px
!
important
;
.input_file
{
.file_name
{
line-height
:
30px
;
width
:
240px
;
height
:
28px
;
overflow
:
hidden
;
}
.file_upload
{
position
:
absolute
;
right
:
14px
;
top
:
7px
;
}
.input-file
{
width
:
260px
;
height
:
41px
;
float
:
right
;
}
}
}
.input-file
{
font
:
500px
monospace
;
opacity
:
0
;
filter
:
alpha
(
opacity
=
0
);
position
:
absolute
;
z-index
:
1
;
top
:
0
;
right
:
0
;
padding
:
0
;
margin
:
0
;
}
// TODO: end cleanup
/* loading indicator */
.notes-busy
{
margin
:
18px
;
}
app/views/issues/show.html.haml
View file @
4ed82788
...
...
@@ -61,4 +61,4 @@
=
markdown
@issue
.
description
.
issue_notes.
voting_notes
#notes
=
render
"notes/notes_with_form"
.voting_notes
#notes
=
render
"notes/notes_with_form"
app/views/notes/_form.html.haml
View file @
4ed82788
...
...
@@ -6,7 +6,7 @@
=
f
.
hidden_field
:noteable_type
.note_text_and_preview.js-toggler-container
%a
.js-note-preview-button.js-toggler-target.turn-o
n
{
href:
"javascript:;"
,
data:
{
title:
"Preview"
,
url:
preview_project_notes_path
(
@project
)}
}
%a
.js-note-preview-button.js-toggler-target.turn-o
ff
{
href:
"javascript:;"
,
data:
{
title:
"Preview"
,
url:
preview_project_notes_path
(
@project
)}
}
%i
.icon-eye-open
%a
.js-note-edit-button.js-toggler-target.turn-off
{
href:
"javascript:;"
,
data:
{
title:
"Edit"
}
}
%i
.icon-edit
...
...
@@ -37,7 +37,7 @@
=
check_box_tag
:notify
,
1
,
!
@note
.
for_commit?
%span
Project team
-
if
@note
.
notify_only_author?
(
current_user
)
-
if
@note
.
notify_only_author?
(
current_user
)
# FIXME: put in JS
=
label_tag
:notify_author
do
=
check_box_tag
:notify_author
,
1
,
!
@note
.
for_commit?
%span
Commit author
...
...
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