Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
97ecae00
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 搜索 >>
提交
97ecae00
编写于
2月 08, 2017
作者:
S
Simon Knox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch notes to use task_list, but keep its update function for now
上级
3bb07a88
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
19 deletion
+14
-19
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+7
-14
app/assets/javascripts/task_list.js.es6
app/assets/javascripts/task_list.js.es6
+7
-5
未找到文件。
app/assets/javascripts/notes.js
浏览文件 @
97ecae00
...
...
@@ -11,7 +11,7 @@ require('./dropzone_input');
require
(
'
./gfm_auto_complete
'
);
require
(
'
vendor/jquery.caret
'
);
// required by jquery.atwho
require
(
'
vendor/jquery.atwho
'
);
require
(
'
vendor
/task_list
'
);
require
(
'
.
/task_list
'
);
(
function
()
{
var
bind
=
function
(
fn
,
me
)
{
return
function
()
{
return
fn
.
apply
(
me
,
arguments
);
};
};
...
...
@@ -51,7 +51,11 @@ require('vendor/task_list');
this
.
addBinding
();
this
.
setPollingInterval
();
this
.
setupMainTargetNoteForm
();
this
.
initTaskList
();
this
.
taskList
=
new
gl
.
TaskList
({
dataType
:
'
note
'
,
selector
:
'
.notes
'
,
update
:
this
.
updateTaskList
.
bind
(
this
)
});
this
.
collapseLongCommitList
();
// We are in the Merge Requests page so we need another edit form for Changes tab
...
...
@@ -125,8 +129,6 @@ require('vendor/task_list');
$
(
document
).
off
(
"
keydown
"
,
"
.js-note-text
"
);
$
(
document
).
off
(
'
click
'
,
'
.js-comment-resolve-button
'
);
$
(
document
).
off
(
"
click
"
,
'
.system-note-commit-list-toggler
'
);
$
(
'
.note .js-task-list-container
'
).
taskList
(
'
disable
'
);
return
$
(
document
).
off
(
'
tasklist:changed
'
,
'
.note .js-task-list-container
'
);
};
Notes
.
prototype
.
keydownNoteText
=
function
(
e
)
{
...
...
@@ -286,7 +288,7 @@ require('vendor/task_list');
// Update datetime format on the recent note
gl
.
utils
.
localTimeAgo
(
$notesList
.
find
(
"
#note_
"
+
note
.
id
+
"
.js-timeago
"
),
false
);
this
.
collapseLongCommitList
();
this
.
initTaskLis
t
();
this
.
taskList
.
ini
t
();
this
.
refresh
();
return
this
.
updateNotesCount
(
1
);
}
...
...
@@ -863,15 +865,6 @@ require('vendor/task_list');
}
};
Notes
.
prototype
.
initTaskList
=
function
()
{
this
.
enableTaskList
();
return
$
(
document
).
on
(
'
tasklist:changed
'
,
'
.note .js-task-list-container
'
,
this
.
updateTaskList
.
bind
(
this
));
};
Notes
.
prototype
.
enableTaskList
=
function
()
{
return
$
(
'
.note .js-task-list-container
'
).
taskList
(
'
enable
'
);
};
Notes
.
prototype
.
putEditFormInPlace
=
function
(
$el
)
{
var
$editForm
=
$
(
this
.
getEditFormSelector
(
$el
));
var
$note
=
$el
.
closest
(
'
.note
'
);
...
...
app/assets/javascripts/task_list.js.es6
浏览文件 @
97ecae00
/* eslint-disable class-methods-use-this, no-new, func-names, prefer-template, no-unneeded-ternary, object-shorthand, space-before-function-paren, comma-dangle, quote-props, consistent-return, no-else-return, no-param-reassign, max-len */
/* global UsersSelect */
require('vendor/task_list');
class TaskList {
constructor(options = {}) {
this.selector = options.selector;
this.dataType = options.dataType;
// Prevent duplicate event bindings
this.disable();
this.update = options.update || this.update.bind(this);
this.init();
}
init() {
// Prevent duplicate event bindings
this.disable();
$(this.selector + ' .js-task-list-container').taskList('enable');
$(document).on('tasklist:changed', this.selector + ' .js-task-list-container', this.update
.bind(this)
);
$(document).on('tasklist:changed', this.selector + ' .js-task-list-container', this.update);
}
disable() {
...
...
@@ -34,8 +38,6 @@ class TaskList {
document.querySelector('#task_status_short').innerText = result.task_status_short;
}
});
// TODO (rspeicher): Make the issue description inline-editable like a note so
// that we can re-use its form here
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录