Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
fdfab012
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,发现更多精彩内容 >>
提交
fdfab012
编写于
8月 13, 2017
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes autosave not enabling comment button when it is restored.
Adds back missing CSS class that was breaking tests
上级
c9ac28fa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
17 deletion
+20
-17
app/assets/javascripts/autosave.js
app/assets/javascripts/autosave.js
+14
-7
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+4
-4
app/assets/javascripts/notes/mixins/autosave.js
app/assets/javascripts/notes/mixins/autosave.js
+1
-1
app/assets/javascripts/notes/stores/getters.js
app/assets/javascripts/notes/stores/getters.js
+1
-1
app/assets/stylesheets/pages/note_form.scss
app/assets/stylesheets/pages/note_form.scss
+0
-4
未找到文件。
app/assets/javascripts/autosave.js
浏览文件 @
fdfab012
...
...
@@ -2,17 +2,17 @@
import
AccessorUtilities
from
'
./lib/utils/accessor
'
;
window
.
Autosave
=
(
function
()
{
function
Autosave
(
field
,
key
)
{
function
Autosave
(
field
,
key
,
resource
)
{
this
.
field
=
field
;
this
.
isLocalStorageAvailable
=
AccessorUtilities
.
isLocalStorageAccessSafe
();
this
.
resource
=
resource
;
if
(
key
.
join
!=
null
)
{
key
=
key
.
join
(
"
/
"
);
key
=
key
.
join
(
'
/
'
);
}
this
.
key
=
"
autosave/
"
+
key
;
this
.
field
.
data
(
"
autosave
"
,
this
);
this
.
key
=
'
autosave/
'
+
key
;
this
.
field
.
data
(
'
autosave
'
,
this
);
this
.
restore
();
this
.
field
.
on
(
"
input
"
,
(
function
(
_this
)
{
this
.
field
.
on
(
'
input
'
,
(
function
(
_this
)
{
return
function
()
{
return
_this
.
save
();
};
...
...
@@ -29,7 +29,14 @@ window.Autosave = (function() {
if
((
text
!=
null
?
text
.
length
:
void
0
)
>
0
)
{
this
.
field
.
val
(
text
);
}
return
this
.
field
.
trigger
(
"
input
"
);
if
(
!
this
.
resource
&&
this
.
resource
!==
'
issue
'
)
{
this
.
field
.
trigger
(
'
input
'
);
}
else
{
// v-model does not update with jQuery trigger
// https://github.com/vuejs/vue/issues/2804#issuecomment-216968137
const
event
=
new
Event
(
'
change
'
,
{
bubbles
:
true
,
cancelable
:
false
});
this
.
field
.
get
(
0
).
dispatchEvent
(
event
);
}
};
Autosave
.
prototype
.
save
=
function
()
{
...
...
app/assets/javascripts/notes/components/issue_comment_form.vue
浏览文件 @
fdfab012
...
...
@@ -184,7 +184,7 @@
}
},
initAutoSave
()
{
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
getIssueData
.
id
]);
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
getIssueData
.
id
]
,
'
issue
'
);
},
initTaskList
()
{
return
new
TaskList
({
...
...
@@ -211,7 +211,7 @@
<issue-note-signed-out-widget
v-if=
"!isLoggedIn"
/>
<ul
v-else
class=
"notes notes-form timeline
new-note
"
>
class=
"notes notes-form timeline"
>
<li
class=
"timeline-entry"
>
<div
class=
"timeline-entry-inner"
>
<div
class=
"timeline-icon hidden-xs hidden-sm"
>
...
...
@@ -223,10 +223,10 @@
:img-size=
"40"
/>
</div>
<div
>
<div
class=
"timeline-content timeline-content-form"
>
<form
ref=
"commentForm"
class=
"
js-main-target-form timeline-content timeline-content-form common-note
-form"
>
class=
"
new-note js-quick-submit common-note-form gfm-form js-main-target
-form"
>
<div
class=
"flash-container timeline-content"
></div>
<confidentialIssue
v-if=
"isConfidentialIssue"
/>
<markdown-field
...
...
app/assets/javascripts/notes/mixins/autosave.js
浏览文件 @
fdfab012
...
...
@@ -4,7 +4,7 @@ import '../../autosave';
export
default
{
methods
:
{
initAutoSave
()
{
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
noteForm
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
note
.
id
]);
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
noteForm
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
note
.
id
]
,
'
issue
'
);
},
resetAutoSave
()
{
this
.
autosave
.
reset
();
...
...
app/assets/javascripts/notes/stores/getters.js
浏览文件 @
fdfab012
...
...
@@ -19,7 +19,7 @@ export const notesById = state => state.notes.reduce((acc, note) => {
const
reverseNotes
=
array
=>
array
.
slice
(
0
).
reverse
();
const
isLastNote
=
(
note
,
state
)
=>
!
note
.
system
&&
state
.
userData
&&
state
.
userData
!==
undefined
&&
note
.
author
.
id
===
state
.
userData
.
id
;
export
const
getCurrentUserLastNote
=
state
=>
_
.
flatten
(
...
...
app/assets/stylesheets/pages/note_form.scss
浏览文件 @
fdfab012
...
...
@@ -20,10 +20,6 @@
}
}
.new-note
{
display
:
none
;
}
.new-note
,
.note-edit-form
{
.note-form-actions
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录