Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
299aad3d
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,发现更多精彩内容 >>
未验证
提交
299aad3d
编写于
4月 05, 2018
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed staged content not updating
上级
26901470
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
8 deletion
+25
-8
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
...s/javascripts/ide/components/commit_sidebar/list_item.vue
+7
-1
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+7
-1
app/assets/javascripts/ide/lib/common/model.js
app/assets/javascripts/ide/lib/common/model.js
+7
-0
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+2
-5
app/assets/javascripts/ide/stores/mutations/file.js
app/assets/javascripts/ide/stores/mutations/file.js
+2
-1
未找到文件。
app/assets/javascripts/ide/components/commit_sidebar/list_item.vue
浏览文件 @
299aad3d
...
...
@@ -29,7 +29,13 @@ export default {
},
},
methods
:
{
...
mapActions
([
'
discardFileChanges
'
,
'
updateViewer
'
,
'
openPendingTab
'
]),
...
mapActions
([
'
discardFileChanges
'
,
'
updateViewer
'
,
'
openPendingTab
'
,
'
unstageChange
'
,
'
stageChange
'
,
]),
openFileInEditor
()
{
return
this
.
openPendingTab
({
file
:
this
.
file
,
...
...
app/assets/javascripts/ide/components/repo_editor.vue
浏览文件 @
299aad3d
...
...
@@ -69,7 +69,13 @@ export default {
path
:
this
.
file
.
path
,
baseSha
:
this
.
currentMergeRequest
?
this
.
currentMergeRequest
.
baseCommitSha
:
''
,
})
.
then
(()
=>
this
.
updateViewer
(
this
.
file
.
pending
?
'
diff
'
:
this
.
viewer
))
.
then
(()
=>
{
const
viewerPromise
=
this
.
delayViewerUpdated
?
this
.
updateViewer
(
'
editor
'
)
:
Promise
.
resolve
();
return
viewerPromise
;
})
.
then
(()
=>
{
this
.
updateDelayViewerUpdated
(
false
);
this
.
createEditorInstance
();
...
...
app/assets/javascripts/ide/lib/common/model.js
浏览文件 @
299aad3d
...
...
@@ -34,10 +34,12 @@ export default class Model {
this
.
events
=
new
Map
();
this
.
updateContent
=
this
.
updateContent
.
bind
(
this
);
this
.
updateNewContent
=
this
.
updateNewContent
.
bind
(
this
);
this
.
dispose
=
this
.
dispose
.
bind
(
this
);
eventHub
.
$on
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$on
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$on
(
`editor.update.model.new.content.
${
this
.
file
.
key
}
`
,
this
.
updateNewContent
);
}
get
url
()
{
...
...
@@ -87,11 +89,16 @@ export default class Model {
}
}
updateNewContent
(
content
)
{
this
.
getModel
().
setValue
(
content
);
}
dispose
()
{
this
.
disposable
.
dispose
();
this
.
events
.
clear
();
eventHub
.
$off
(
`editor.update.model.dispose.
${
this
.
file
.
key
}
`
,
this
.
dispose
);
eventHub
.
$off
(
`editor.update.model.content.
${
this
.
file
.
key
}
`
,
this
.
updateContent
);
eventHub
.
$off
(
`editor.update.model.new.content.
${
this
.
file
.
key
}
`
,
this
.
updateNewContent
);
}
}
app/assets/javascripts/ide/stores/actions/file.js
浏览文件 @
299aad3d
...
...
@@ -174,10 +174,7 @@ export const stageChange = ({ commit, state }, path) => {
commit
(
types
.
STAGE_CHANGE
,
path
);
if
(
stagedFile
)
{
eventHub
.
$emit
(
`editor.update.model.content.staged-
${
stagedFile
.
key
}
`
,
{
content
:
stagedFile
.
content
,
changed
:
false
,
});
eventHub
.
$emit
(
`editor.update.model.new.content.staged-
${
stagedFile
.
key
}
`
,
stagedFile
.
content
);
}
};
...
...
@@ -186,7 +183,7 @@ export const unstageChange = ({ commit }, path) => {
};
export
const
openPendingTab
=
({
commit
,
getters
,
dispatch
,
state
},
{
file
,
keyPrefix
})
=>
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
.
path
===
file
.
path
&&
state
.
viewer
===
'
diff
'
)
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
===
file
&&
state
.
viewer
===
'
diff
'
)
{
return
false
;
}
...
...
app/assets/javascripts/ide/stores/mutations/file.js
浏览文件 @
299aad3d
...
...
@@ -156,7 +156,7 @@ export default {
[
types
.
ADD_PENDING_TAB
](
state
,
{
file
,
keyPrefix
=
'
pending
'
})
{
const
pendingTab
=
state
.
openFiles
.
find
(
f
=>
f
.
path
===
file
.
path
&&
f
.
pending
);
let
openFiles
=
state
.
openFiles
.
map
(
f
=>
Object
.
assign
(
f
,
{
active
:
f
.
path
===
file
.
path
,
opened
:
false
}),
Object
.
assign
(
f
,
{
active
:
f
.
path
===
file
.
path
,
opened
:
false
,
active
:
false
}),
);
if
(
!
pendingTab
)
{
...
...
@@ -168,6 +168,7 @@ export default {
if
(
f
.
path
===
file
.
path
)
{
return
acc
.
concat
({
...
f
,
content
:
file
.
content
,
active
:
true
,
pending
:
true
,
opened
:
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录