Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
fe5d2c55
Commit
fe5d2c55
authored
7 years ago
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Discard changes to files when cancel edit is hit.
parent
77ab714a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
18 deletions
+42
-18
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+0
-1
app/assets/javascripts/repo/repo_edit_button.js
app/assets/javascripts/repo/repo_edit_button.js
+0
-11
app/assets/javascripts/repo/repo_editor.vue
app/assets/javascripts/repo/repo_editor.vue
+17
-0
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-1
app/assets/javascripts/repo/repo_tab.vue
app/assets/javascripts/repo/repo_tab.vue
+1
-1
app/assets/javascripts/repo/repo_tabs.vue
app/assets/javascripts/repo/repo_tabs.vue
+5
-1
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+18
-3
No files found.
app/assets/javascripts/repo/index.js
View file @
fe5d2c55
...
@@ -37,7 +37,6 @@ function addEventsForNonVueEls() {
...
@@ -37,7 +37,6 @@ function addEventsForNonVueEls() {
window
.
onbeforeunload
=
function
(
e
)
{
window
.
onbeforeunload
=
function
(
e
)
{
const
hasChanged
=
Store
.
openedFiles
const
hasChanged
=
Store
.
openedFiles
.
some
(
file
=>
file
.
changed
);
.
some
(
file
=>
file
.
changed
);
console
.
log
(
'
hasChanged
'
,
hasChanged
)
if
(
!
hasChanged
)
return
;
if
(
!
hasChanged
)
return
;
e
=
e
||
window
.
event
;
e
=
e
||
window
.
event
;
if
(
e
)
{
if
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/repo/repo_edit_button.js
View file @
fe5d2c55
...
@@ -30,17 +30,6 @@ export default class RepoEditButton {
...
@@ -30,17 +30,6 @@ export default class RepoEditButton {
this
.
editMode
=
!
this
.
editMode
;
this
.
editMode
=
!
this
.
editMode
;
},
},
},
},
watch
:
{
dialog
:
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
obj
.
status
=
false
;
}
},
deep
:
true
,
}
}
});
});
}
}
}
}
This diff is collapsed.
Click to expand it.
app/assets/javascripts/repo/repo_editor.vue
View file @
fe5d2c55
...
@@ -86,6 +86,23 @@ const RepoEditor = {
...
@@ -86,6 +86,23 @@ const RepoEditor = {
this
.
showHide
();
this
.
showHide
();
},
},
dialog
:
{
handler
(
obj
)
{
if
(
obj
.
status
)
{
obj
.
status
=
false
;
this
.
openedFiles
.
map
((
f
)
=>
{
if
(
f
.
active
)
{
this
.
blobRaw
=
f
.
plain
;
}
f
.
changed
=
false
;
delete
f
.
newContent
;
});
this
.
editMode
=
false
;
}
},
deep
:
true
,
},
isTree
()
{
isTree
()
{
this
.
showHide
();
this
.
showHide
();
},
},
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/repo/repo_store.js
View file @
fe5d2c55
...
@@ -97,7 +97,7 @@ const RepoStore = {
...
@@ -97,7 +97,7 @@ const RepoStore = {
RepoStore
.
blobRaw
=
file
.
base64
;
RepoStore
.
blobRaw
=
file
.
base64
;
RepoStore
.
binaryMimeType
=
file
.
mime_type
;
RepoStore
.
binaryMimeType
=
file
.
mime_type
;
}
else
{
}
else
{
RepoStore
.
blobRaw
=
file
.
plain
;
RepoStore
.
blobRaw
=
file
.
newContent
||
file
.
plain
;
}
}
if
(
!
file
.
loading
)
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
);
if
(
!
file
.
loading
)
RepoHelper
.
toURL
(
file
.
url
,
file
.
name
);
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/repo/repo_tab.vue
View file @
fe5d2c55
...
@@ -24,7 +24,7 @@ const RepoTab = {
...
@@ -24,7 +24,7 @@ const RepoTab = {
xClicked
(
file
)
{
xClicked
(
file
)
{
if
(
file
.
changed
)
return
;
if
(
file
.
changed
)
return
;
RepoStore
.
removeFromOpenedFiles
(
file
);
this
.
$emit
(
'
xclicked
'
,
file
);
},
},
},
},
};
};
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/repo/repo_tabs.vue
View file @
fe5d2c55
...
@@ -17,6 +17,10 @@ const RepoTabs = {
...
@@ -17,6 +17,10 @@ const RepoTabs = {
isOverflow
()
{
isOverflow
()
{
return
this
.
$el
.
scrollWidth
>
this
.
$el
.
offsetWidth
;
return
this
.
$el
.
scrollWidth
>
this
.
$el
.
offsetWidth
;
},
},
xclicked
(
file
)
{
Store
.
removeFromOpenedFiles
(
file
);
}
},
},
watch
:
{
watch
:
{
...
@@ -33,6 +37,6 @@ export default RepoTabs;
...
@@ -33,6 +37,6 @@ export default RepoTabs;
<
template
>
<
template
>
<ul
id=
"tabs"
v-if=
"isMini"
v-cloak
:class=
"
{'overflown': tabsOverflow}">
<ul
id=
"tabs"
v-if=
"isMini"
v-cloak
:class=
"
{'overflown': tabsOverflow}">
<repo-tab
v-for=
"tab in openedFiles"
:key=
"tab.id"
:tab=
"tab"
:class=
"
{'active' : tab.active}"/>
<repo-tab
v-for=
"tab in openedFiles"
:key=
"tab.id"
:tab=
"tab"
:class=
"
{'active' : tab.active}"
@xclicked="xclicked"
/>
</ul>
</ul>
</
template
>
</
template
>
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/pages/repo.scss
View file @
fe5d2c55
...
@@ -97,6 +97,15 @@
...
@@ -97,6 +97,15 @@
white-space
:
nowrap
;
white-space
:
nowrap
;
border-radius
:
3px
3px
0
0
;
border-radius
:
3px
3px
0
0
;
&
.remove
{
animation
:
swipeRightDissapear
ease-in
0
.1s
;
animation-iteration-count
:
1
;
transform-origin
:
0%
50%
;
a
{
width
:
0
;
}
}
&
.active
{
&
.active
{
background
:
$white-light
;
background
:
$white-light
;
}
}
...
@@ -372,11 +381,17 @@
...
@@ -372,11 +381,17 @@
transform
:
scaleX
(
0
.00
);
transform
:
scaleX
(
0
.00
);
}
}
45
%
{
100
%
{
transform
:
scaleX
(
0
.26
);
transform
:
scaleX
(
1
.00
);
}
}
}
100
%
{
@keyframes
swipeRightDissapear
{
0
%
{
transform
:
scaleX
(
1
.00
);
transform
:
scaleX
(
1
.00
);
}
}
100
%
{
transform
:
scaleX
(
0
.00
);
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment