Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1f508334
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1f508334
编写于
3月 30, 2016
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated tests
上级
ccc64676
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
7 deletion
+11
-7
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+9
-5
features/steps/shared/note.rb
features/steps/shared/note.rb
+1
-1
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+1
-1
未找到文件。
app/assets/javascripts/notes.js.coffee
浏览文件 @
1f508334
...
@@ -65,6 +65,8 @@ class @Notes
...
@@ -65,6 +65,8 @@ class @Notes
# add diff note
# add diff note
$
(
document
).
on
"click"
,
".js-add-diff-note-button"
,
@
addDiffNote
$
(
document
).
on
"click"
,
".js-add-diff-note-button"
,
@
addDiffNote
$
(
document
).
on
"mouseover"
,
".js-add-diff-note-button"
,
->
console
.
log
$
(
this
).
data
(
'line-code'
)
# hide diff note form
# hide diff note form
$
(
document
).
on
"click"
,
".js-close-discussion-note-form"
,
@
cancelDiscussionForm
$
(
document
).
on
"click"
,
".js-close-discussion-note-form"
,
@
cancelDiscussionForm
...
@@ -264,6 +266,8 @@ class @Notes
...
@@ -264,6 +266,8 @@ class @Notes
form
.
removeClass
"js-new-note-form"
form
.
removeClass
"js-new-note-form"
form
.
addClass
"js-main-target-form"
form
.
addClass
"js-main-target-form"
form
.
find
(
"#note_line_code"
).
remove
()
###
###
General note form setup.
General note form setup.
...
@@ -500,8 +504,9 @@ class @Notes
...
@@ -500,8 +504,9 @@ class @Notes
###
###
addDiffNote
:
(
e
)
=>
addDiffNote
:
(
e
)
=>
e
.
preventDefault
()
e
.
preventDefault
()
link
=
e
.
currentTarget
$link
=
$
(
e
.
currentTarget
)
row
=
$
(
link
).
closest
(
"tr"
)
console
.
log
$link
.
data
(
'line-code'
)
row
=
$link
.
closest
(
"tr"
)
nextRow
=
row
.
next
()
nextRow
=
row
.
next
()
hasNotes
=
nextRow
.
is
(
".notes_holder"
)
hasNotes
=
nextRow
.
is
(
".notes_holder"
)
addForm
=
false
addForm
=
false
...
@@ -510,7 +515,7 @@ class @Notes
...
@@ -510,7 +515,7 @@ class @Notes
# In parallel view, look inside the correct left/right pane
# In parallel view, look inside the correct left/right pane
if
@
isParallelView
()
if
@
isParallelView
()
lineType
=
$
(
link
)
.
data
(
"lineType"
)
lineType
=
$
link
.
data
(
"lineType"
)
targetContent
+=
"."
+
lineType
targetContent
+=
"."
+
lineType
rowCssToAdd
=
"<tr class=
\"
notes_holder js-temp-notes-holder
\"
><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel old
\"
></td><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel new
\"
></td></tr>"
rowCssToAdd
=
"<tr class=
\"
notes_holder js-temp-notes-holder
\"
><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel old
\"
></td><td class=
\"
notes_line
\"
></td><td class=
\"
notes_content parallel new
\"
></td></tr>"
...
@@ -536,7 +541,7 @@ class @Notes
...
@@ -536,7 +541,7 @@ class @Notes
newForm
.
appendTo
row
.
next
().
find
(
targetContent
)
newForm
.
appendTo
row
.
next
().
find
(
targetContent
)
# show the form
# show the form
@
setupDiscussionNoteForm
$
(
link
)
,
newForm
@
setupDiscussionNoteForm
$
link
,
newForm
###
###
Called in response to "cancel" on a diff note form.
Called in response to "cancel" on a diff note form.
...
@@ -561,7 +566,6 @@ class @Notes
...
@@ -561,7 +566,6 @@ class @Notes
cancelDiscussionForm
:
(
e
)
=>
cancelDiscussionForm
:
(
e
)
=>
e
.
preventDefault
()
e
.
preventDefault
()
form
=
$
(
".js-new-note-form"
)
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
form
=
$
(
e
.
target
).
closest
(
".js-discussion-note-form"
)
@
removeDiscussionNoteForm
(
form
)
@
removeDiscussionNoteForm
(
form
)
...
...
features/steps/shared/note.rb
浏览文件 @
1f508334
...
@@ -128,7 +128,7 @@ module SharedNote
...
@@ -128,7 +128,7 @@ module SharedNote
end
end
step
'I edit the last comment with a +1'
do
step
'I edit the last comment with a +1'
do
page
.
within
(
".
notes
"
)
do
page
.
within
(
".
main-notes-list
"
)
do
find
(
".note"
).
hover
find
(
".note"
).
hover
find
(
'.js-note-edit'
).
click
find
(
'.js-note-edit'
).
click
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
浏览文件 @
1f508334
...
@@ -225,6 +225,6 @@ describe 'Comments', feature: true do
...
@@ -225,6 +225,6 @@ describe 'Comments', feature: true do
end
end
def
click_diff_line
(
data
=
line_code
)
def
click_diff_line
(
data
=
line_code
)
page
.
find
(
%Q{button[data-line-code="
#{
data
}
"]}
,
visible:
false
).
click
execute_script
(
"$('button[data-line-code=
\"
#{
data
}
\"
]').click()"
)
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录