Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
7e7673d5
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 搜索 >>
提交
7e7673d5
编写于
8月 15, 2016
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed bug when moving lists around & then deleting
上级
d4387bd3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
13 deletion
+26
-13
app/assets/javascripts/boards/components/board.js.es6
app/assets/javascripts/boards/components/board.js.es6
+15
-8
app/assets/javascripts/boards/components/board_delete.js.es6
app/assets/javascripts/boards/components/board_delete.js.es6
+4
-1
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+1
-0
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+2
-3
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+4
-1
未找到文件。
app/assets/javascripts/boards/components/board.js.es6
浏览文件 @
7e7673d5
...
...
@@ -64,9 +64,20 @@
group: 'boards',
draggable: '.is-draggable',
handle: '.js-board-handle',
onUpdate: (e) => {
if (e.oldIndex !== e.newIndex) {
gl.issueBoards.BoardsStore.moveList(e.oldIndex, this.sortable.toArray());
onEnd: (e) => {
document.body.classList.remove('is-dragging');
if (e.newIndex !== undefined && e.oldIndex !== e.newIndex) {
const order = this.sortable.toArray(),
$board = this.$parent.$refs.board[e.oldIndex + 1],
list = $board.list;
$board.$destroy(true);
this.$nextTick(() => {
gl.issueBoards.BoardsStore.state.lists.splice(e.newIndex, 0, list);
gl.issueBoards.BoardsStore.moveList(list, order);
});
}
}
});
...
...
@@ -78,11 +89,7 @@
this.sortable = Sortable.create(this.$el.parentNode, options);
},
beforeDestroy () {
this.list.destroy();
if (gl.issueBoards.BoardsStore.state.lists.length === 0) {
this.sortable.destroy();
}
gl.issueBoards.BoardsStore.state.lists.$remove(this.list);
}
});
})();
app/assets/javascripts/boards/components/board_delete.js.es6
浏览文件 @
7e7673d5
...
...
@@ -3,13 +3,16 @@
window.gl.issueBoards = window.gl.issueBoards || {};
gl.issueBoards.BoardDelete = Vue.extend({
props: {
list: Object
},
methods: {
deleteBoard (e) {
e.stopImmediatePropagation();
$(this.$el).tooltip('hide');
if (confirm('Are you sure you want to delete this list?')) {
this.
$parent.$destroy(true
);
this.
list.destroy(
);
}
}
}
...
...
app/assets/javascripts/boards/models/list.js.es6
浏览文件 @
7e7673d5
class List {
constructor (obj) {
this.id = obj.id;
this._uid = Math.ceil(Math.random() * 1000);
this.position = obj.position;
this.title = obj.title;
this.type = obj.list_type;
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
浏览文件 @
7e7673d5
...
...
@@ -80,15 +80,14 @@
return list.id !== id;
});
},
moveList (oldIndex, orderLists) {
const listFrom = this.findList('position', oldIndex);
moveList (listFrom, orderLists) {
for (let i = 0, orderLength = orderLists.length; i < orderLength; i++) {
const id = parseInt(orderLists[i]),
list = this.findList('id', id);
list.position = i;
}
listFrom.update();
},
moveIssueToList (listFrom, listTo, issue) {
const issueTo = listTo.findIssue(issue.id),
...
...
app/views/projects/boards/components/_board.html.haml
浏览文件 @
7e7673d5
%board
{
"inline-template"
=>
true
,
"v-cloak"
=>
true
,
"v-for"
=>
"list in state.lists | orderBy 'position'"
,
"v-ref:board"
=>
true
,
":list"
=>
"list"
,
":disabled"
=>
"disabled"
,
":issue-link-base"
=>
"issueLinkBase"
}
":issue-link-base"
=>
"issueLinkBase"
,
"track-by"
=>
"_uid"
}
.board
{
":class"
=>
"{ 'is-draggable': !isPreset }"
,
":data-id"
=>
"list.id"
}
.board-inner
...
...
@@ -15,6 +17,7 @@
{{ list.issues.length }}
-
if
can?
(
current_user
,
:admin_list
,
@project
)
%board-delete
{
"inline-template"
=>
true
,
":list"
=>
"list"
,
"v-if"
=>
"!isPreset && list.id"
}
%button
.board-delete.has-tooltip.pull-right
{
type:
"button"
,
title:
"Delete list"
,
"aria-label"
=>
"Delete list"
,
data:
{
placement:
"bottom"
},
"@click.stop"
=>
"deleteBoard"
}
=
icon
(
"trash"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录