BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c6abeffe
Commit
c6abeffe
authored
Jul 06, 2016
by
Paco Guzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the comment diff button where it should be
parent
40398d56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
files_comment_button.js.coffee
app/assets/javascripts/files_comment_button.js.coffee
+15
-14
No files found.
app/assets/javascripts/files_comment_button.js.coffee
View file @
c6abeffe
...
...
@@ -35,8 +35,7 @@ class @FilesCommentButton
textFileElement
=
@
getTextFileElement
(
currentTarget
)
lineHolderElement
=
@
getLineHolder
(
currentTarget
)
lineContentElement
=
@
getLineContent
(
currentTarget
)
lineNumElement
=
@
getLineNum
(
currentTarget
)
buttonParentElement
=
lineNumElement
buttonParentElement
=
@
getButtonParent
(
currentTarget
)
return
if
not
@
shouldRender
e
,
buttonParentElement
...
...
@@ -55,7 +54,7 @@ class @FilesCommentButton
destroy
:
(
e
)
=>
return
if
@
isMovingToSameType
e
$
(
@
COMMENT_BUTTON_CLASS
,
@
get
LineNum
$
(
e
.
currentTarget
)).
remove
()
$
(
@
COMMENT_BUTTON_CLASS
,
@
get
ButtonParent
$
(
e
.
currentTarget
)).
remove
()
return
buildButton
:
(
buttonAttributes
)
->
...
...
@@ -75,23 +74,25 @@ class @FilesCommentButton
return
hoveredElement
if
hoveredElement
.
hasClass
@
LINE_HOLDER_CLASS
$
(
hoveredElement
.
parent
())
getLineNum
:
(
hoveredElement
)
->
if
@
VIEW_TYPE
is
'inline'
and
hoveredElement
.
hasClass
@
OLD_LINE_CLASS
$
(
hoveredElement
).
next
".
#{
@
LINE_NUMBER_CLASS
}
"
else
if
hoveredElement
.
hasClass
@
LINE_NUMBER_CLASS
hoveredElement
else
$
(
hoveredElement
).
prev
".
#{
@
LINE_NUMBER_CLASS
}
"
getLineContent
:
(
hoveredElement
)
->
return
hoveredElement
if
hoveredElement
.
hasClass
@
LINE_CONTENT_CLASS
$
(
hoveredElement
).
next
".
#{
@
LINE_CONTENT_CLASS
}
"
getButtonParent
:
(
hoveredElement
)
->
if
@
VIEW_TYPE
is
'inline'
return
hoveredElement
if
hoveredElement
.
hasClass
@
OLD_LINE_CLASS
$
(
hoveredElement
).
parent
().
find
".
#{
@
OLD_LINE_CLASS
}
"
else
return
hoveredElement
if
hoveredElement
.
hasClass
@
LINE_NUMBER_CLASS
$
(
hoveredElement
).
prev
".
#{
@
LINE_NUMBER_CLASS
}
"
isMovingToSameType
:
(
e
)
->
new
LineNum
=
@
getLineNum
(
$
(
e
.
toElement
))
return
false
unless
new
LineNum
(
new
LineNum
).
is
@
getLineNum
(
$
(
e
.
currentTarget
))
new
ButtonParent
=
@
getButtonParent
(
$
(
e
.
toElement
))
return
false
unless
new
ButtonParent
(
new
ButtonParent
).
is
@
getButtonParent
(
$
(
e
.
currentTarget
))
shouldRender
:
(
e
,
buttonParentElement
)
->
(
!
buttonParentElement
.
hasClass
(
@
EMPTY_CELL_CLASS
)
and
\
...
...
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