Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
5c0c345a
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,发现更多精彩内容 >>
未验证
提交
5c0c345a
编写于
10月 26, 2017
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
various different performance improvements
[ci skip]
上级
4d18e200
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
24 addition
and
37 deletion
+24
-37
app/assets/javascripts/repo/components/repo.vue
app/assets/javascripts/repo/components/repo.vue
+5
-5
app/assets/javascripts/repo/components/repo_edit_button.vue
app/assets/javascripts/repo/components/repo_edit_button.vue
+1
-1
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+3
-2
app/assets/javascripts/repo/components/repo_file.vue
app/assets/javascripts/repo/components/repo_file.vue
+0
-1
app/assets/javascripts/repo/components/repo_preview.vue
app/assets/javascripts/repo/components/repo_preview.vue
+1
-1
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+8
-5
app/assets/javascripts/repo/stores/actions.js
app/assets/javascripts/repo/stores/actions.js
+3
-3
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+2
-16
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+1
-1
app/views/shared/repo/_editable_mode.html.haml
app/views/shared/repo/_editable_mode.html.haml
+0
-2
未找到文件。
app/assets/javascripts/repo/components/repo.vue
浏览文件 @
5c0c345a
...
...
@@ -11,7 +11,6 @@ export default {
computed
:
{
...
mapState
([
'
currentBlobView
'
,
'
editMode
'
,
]),
...
mapGetters
([
'
isMini
'
,
...
...
@@ -45,13 +44,14 @@ export default {
<div
class=
"repository-view"
>
<div
class=
"tree-content-holder"
:class=
"
{'tree-content-holder-mini' : isMini}">
<repo-sidebar/>
<div
v-if=
"isMini"
class=
"panel-right"
:class=
"
{'edit-mode': editMode}">
<div
v-if=
"isMini"
class=
"panel-right"
>
<repo-tabs/>
<component
:is=
"currentBlobView"
class=
"blob-viewer-container"
/>
/>
<repo-file-buttons/>
</div>
</div>
...
...
app/assets/javascripts/repo/components/repo_edit_button.vue
浏览文件 @
5c0c345a
...
...
@@ -28,7 +28,7 @@ export default {
</
script
>
<
template
>
<div>
<div
class=
"editable-mode"
>
<button
v-if=
"canEditFile"
class=
"btn btn-default"
...
...
app/assets/javascripts/repo/components/repo_editor.vue
浏览文件 @
5c0c345a
...
...
@@ -52,12 +52,13 @@ export default {
},
setupEditor
()
{
if
(
!
this
.
activeFile
)
return
;
const
content
=
this
.
activeFile
.
content
!==
''
?
this
.
activeFile
.
content
:
this
.
activeFile
.
raw
;
const
foundLang
=
this
.
languages
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
this
.
activeFileExtension
)
===
0
,
);
const
newModel
=
this
.
monaco
.
editor
.
createModel
(
this
.
activeFile
.
raw
,
foundLang
?
foundLang
.
id
:
'
plaintext
'
,
content
,
foundLang
?
foundLang
.
id
:
'
plaintext
'
,
);
this
.
monacoInstance
.
setModel
(
newModel
);
...
...
@@ -91,5 +92,5 @@ export default {
</
script
>
<
template
>
<div
id=
"ide"
v-if=
'!shouldHideEditor'
></div>
<div
id=
"ide"
v-if=
'!shouldHideEditor'
class=
"blob-viewer-container blob-editor-container"
></div>
</
template
>
app/assets/javascripts/repo/components/repo_file.vue
浏览文件 @
5c0c345a
...
...
@@ -34,7 +34,6 @@
},
methods
:
{
...
mapActions
([
'
getTreeData
'
,
'
clickedTreeRow
'
,
]),
},
...
...
app/assets/javascripts/repo/components/repo_preview.vue
浏览文件 @
5c0c345a
...
...
@@ -31,7 +31,7 @@ export default {
</
script
>
<
template
>
<div>
<div
class=
"blob-viewer-container"
>
<div
v-if=
"!activeFile.renderError"
v-html=
"activeFile.html"
>
...
...
app/assets/javascripts/repo/index.js
浏览文件 @
5c0c345a
...
...
@@ -5,13 +5,13 @@ import Repo from './components/repo.vue';
import
RepoEditButton
from
'
./components/repo_edit_button.vue
'
;
import
newBranchForm
from
'
./components/new_branch_form.vue
'
;
import
newDropdown
from
'
./components/new_dropdown/index.vue
'
;
import
vS
tore
from
'
./stores
'
;
import
s
tore
from
'
./stores
'
;
import
Translate
from
'
../vue_shared/translate
'
;
function
initRepo
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
repo
:
Repo
,
},
...
...
@@ -53,17 +53,20 @@ function initRepo(el) {
function
initRepoEditButton
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
repoEditButton
:
RepoEditButton
,
},
render
(
createElement
)
{
return
createElement
(
'
repo-edit-button
'
);
},
});
}
function
initNewDropdown
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
newDropdown
,
},
...
...
@@ -83,7 +86,7 @@ function initNewBranchForm() {
components
:
{
newBranchForm
,
},
store
:
vStore
,
store
,
render
(
createElement
)
{
return
createElement
(
'
new-branch-form
'
);
},
...
...
app/assets/javascripts/repo/stores/actions.js
浏览文件 @
5c0c345a
...
...
@@ -10,9 +10,7 @@ export const setInitialData = ({ commit }, data) => commit(types.SET_INITIAL_DAT
export
const
closeDiscardPopup
=
({
commit
})
=>
commit
(
types
.
TOGGLE_DISCARD_POPUP
,
false
);
export
const
discardAllChanges
=
({
state
,
commit
,
getters
,
dispatch
})
=>
{
if
(
state
.
editMode
)
return
;
export
const
discardAllChanges
=
({
commit
,
getters
,
dispatch
})
=>
{
const
changedFiles
=
getters
.
changedFiles
;
changedFiles
.
forEach
((
file
)
=>
{
...
...
@@ -82,6 +80,8 @@ export const commitChanges = ({ commit, state, dispatch }, { payload, newMr }) =
dispatch
(
'
discardAllChanges
'
);
dispatch
(
'
closeAllFiles
'
);
dispatch
(
'
toggleEditMode
'
);
window
.
scrollTo
(
0
,
0
);
}
})
.
catch
(()
=>
flash
(
'
Error committing changes. Please try again.
'
));
...
...
app/assets/stylesheets/pages/repo.scss
浏览文件 @
5c0c345a
...
...
@@ -72,10 +72,6 @@
text-decoration
:
underline
;
}
}
.cursor
{
display
:
none
!
important
;
}
}
.blob-no-preview
{
...
...
@@ -85,18 +81,8 @@
}
}
&
.edit-mode
{
.blob-viewer-container
{
overflow
:
hidden
;
}
.monaco-editor.vs
{
.cursor
{
background
:
$black
;
border-color
:
$black
;
display
:
block
!
important
;
}
}
&
.blob-editor-container
{
overflow
:
hidden
;
}
.blob-viewer-container
{
...
...
app/views/projects/tree/_tree_header.html.haml
浏览文件 @
5c0c345a
...
...
@@ -9,7 +9,7 @@
.tree-controls
-
if
show_new_repo?
=
render
'shared/repo/editable_mode'
.editable-mode
-
else
=
link_to
s_
(
'Commits|History'
),
project_commits_path
(
@project
,
@id
),
class:
'btn'
...
...
app/views/shared/repo/_editable_mode.html.haml
已删除
100644 → 0
浏览文件 @
4d18e200
.editable-mode
%repo-edit-button
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录