Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e7b0334c
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,体验更适合开发者的 AI 搜索 >>
提交
e7b0334c
编写于
8月 31, 2016
作者:
C
Clement Ho
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add textarea autoresize after comment
上级
1c4e8663
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
73 addition
and
13 deletion
+73
-13
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+6
-1
spec/javascripts/fixtures/comments.html.haml
spec/javascripts/fixtures/comments.html.haml
+21
-0
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+45
-12
未找到文件。
CHANGELOG
浏览文件 @
e7b0334c
...
...
@@ -15,6 +15,7 @@ v 8.12.0 (unreleased)
- Fix bug where pagination is still displayed despite all todos marked as done (ClemMakesApps)
- Shorten task status phrase (ClemMakesApps)
- Add hover color to emoji icon (ClemMakesApps)
- Add textarea autoresize after comment (ClemMakesApps)
- Fix branches page dropdown sort alignment (ClemMakesApps)
- Add white background for no readme container (ClemMakesApps)
- API: Expose issue confidentiality flag. (Robert Schilling)
...
...
app/assets/javascripts/notes.js
浏览文件 @
e7b0334c
...
...
@@ -331,7 +331,12 @@
form
.
find
(
"
.js-md-write-button
"
).
click
();
form
.
find
(
"
.js-note-text
"
).
val
(
""
).
trigger
(
"
input
"
);
form
.
find
(
"
.js-note-text
"
).
data
(
"
autosave
"
).
reset
();
return
this
.
updateTargetButtons
(
e
);
var
event
=
document
.
createEvent
(
'
Event
'
);
event
.
initEvent
(
'
autosize:update
'
,
true
,
false
);
form
.
find
(
'
.js-autosize
'
)[
0
].
dispatchEvent
(
event
);
this
.
updateTargetButtons
(
e
);
};
Notes
.
prototype
.
reenableTargetFormSubmitButton
=
function
()
{
...
...
spec/javascripts/fixtures/comments.html.haml
0 → 100644
浏览文件 @
e7b0334c
.flash-container.timeline-content
.timeline-icon.hidden-xs.hidden-sm
%a
.author_link
%img
.timeline-content.timeline-content-form
%form
.new-note.js-quick-submit.common-note-form.gfm-form.js-main-target-form
.md-area
.md-header
.md-write-holder
.zen-backdrop.div-dropzone-wrapper
.div-dropzone-wrapper
.div-dropzone.dz-clickable
%textarea
.note-textarea.js-note-text.js-gfm-input.js-autosize.markdown-area
.note-form-actions.clearfix
%input
.btn.btn-nr.btn-create.append-right-10.comment-btn.js-comment-button
{
type:
'submit'
}
%a
.btn.btn-nr.btn-reopen.btn-comment.js-note-target-reopen
Reopen issue
%a
.btn.btn-nr.btn-close.btn-comment.js-note-target-close
Close issue
%a
.btn.btn-cancel.js-note-discard
Discard draft
\ No newline at end of file
spec/javascripts/notes_spec.js
浏览文件 @
e7b0334c
/*= require notes */
/*= require autosize */
/*= require gl_form */
/*= require lib/utils/text_utility */
(
function
()
{
window
.
gon
||
(
window
.
gon
=
{});
...
...
@@ -12,29 +11,63 @@
};
describe
(
'
Notes
'
,
function
()
{
return
describe
(
'
task lists
'
,
function
()
{
describe
(
'
task lists
'
,
function
()
{
fixture
.
preload
(
'
issue_note.html
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
issue_note.html
'
);
$
(
'
form
'
).
on
(
'
submit
'
,
function
(
e
)
{
return
e
.
preventDefault
();
e
.
preventDefault
();
});
return
this
.
notes
=
new
Notes
();
this
.
notes
=
new
Notes
();
});
it
(
'
modifies the Markdown field
'
,
function
()
{
$
(
'
input[type=checkbox]
'
).
attr
(
'
checked
'
,
true
).
trigger
(
'
change
'
);
return
expect
(
$
(
'
.js-task-list-field
'
).
val
()).
toBe
(
'
- [x] Task List Item
'
);
expect
(
$
(
'
.js-task-list-field
'
).
val
()).
toBe
(
'
- [x] Task List Item
'
);
});
return
it
(
'
submits the form on tasklist:changed
'
,
function
()
{
var
submitted
;
submitted
=
false
;
it
(
'
submits the form on tasklist:changed
'
,
function
()
{
var
submitted
=
false
;
$
(
'
form
'
).
on
(
'
submit
'
,
function
(
e
)
{
submitted
=
true
;
return
e
.
preventDefault
();
e
.
preventDefault
();
});
$
(
'
.js-task-list-field
'
).
trigger
(
'
tasklist:changed
'
);
return
expect
(
submitted
).
toBe
(
true
);
expect
(
submitted
).
toBe
(
true
);
});
});
describe
(
'
comments
'
,
function
()
{
var
commentsTemplate
=
'
comments.html
'
;
var
textarea
=
'
.js-note-text
'
;
fixture
.
preload
(
commentsTemplate
);
beforeEach
(
function
()
{
fixture
.
load
(
commentsTemplate
);
this
.
notes
=
new
Notes
();
this
.
autoSizeSpy
=
spyOnEvent
(
$
(
textarea
),
'
autosize:update
'
);
spyOn
(
this
.
notes
,
'
renderNote
'
).
and
.
stub
();
$
(
textarea
).
data
(
'
autosave
'
,
{
reset
:
function
()
{}
});
$
(
'
form
'
).
on
(
'
submit
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'
.js-main-target-form
'
).
trigger
(
'
ajax:success
'
);
});
});
it
(
'
autosizes after comment submission
'
,
function
()
{
$
(
textarea
).
text
(
'
This is an example comment note
'
);
expect
(
this
.
autoSizeSpy
).
not
.
toHaveBeenTriggered
();
$
(
'
.js-comment-button
'
).
click
();
expect
(
this
.
autoSizeSpy
).
toHaveBeenTriggered
();
})
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录