Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
2912d0e3
Commit
2912d0e3
authored
9 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #19499 from owncloud/files-versions-properlyreloadafterrevert
Reload versions list after revert
parents
f9093688
b6114ba2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_versions/js/versioncollection.js
+5
-0
5 additions, 0 deletions
apps/files_versions/js/versioncollection.js
apps/files_versions/js/versionstabview.js
+8
-2
8 additions, 2 deletions
apps/files_versions/js/versionstabview.js
with
13 additions
and
2 deletions
apps/files_versions/js/versioncollection.js
+
5
−
0
View file @
2912d0e3
...
@@ -67,6 +67,11 @@
...
@@ -67,6 +67,11 @@
return
this
.
fetch
({
remove
:
false
});
return
this
.
fetch
({
remove
:
false
});
},
},
reset
:
function
()
{
this
.
_currentIndex
=
0
;
OC
.
Backbone
.
Collection
.
prototype
.
reset
.
apply
(
this
,
arguments
);
},
parse
:
function
(
result
)
{
parse
:
function
(
result
)
{
var
results
=
_
.
map
(
result
.
data
.
versions
,
function
(
version
)
{
var
results
=
_
.
map
(
result
.
data
.
versions
,
function
(
version
)
{
var
revision
=
parseInt
(
version
.
version
,
10
);
var
revision
=
parseInt
(
version
.
version
,
10
);
...
...
This diff is collapsed.
Click to expand it.
apps/files_versions/js/versionstabview.js
+
8
−
2
View file @
2912d0e3
...
@@ -85,12 +85,18 @@
...
@@ -85,12 +85,18 @@
ev
.
preventDefault
();
ev
.
preventDefault
();
revision
=
$target
.
attr
(
'
data-revision
'
);
revision
=
$target
.
attr
(
'
data-revision
'
);
this
.
$el
.
find
(
'
.versions, .showMoreVersions
'
).
addClass
(
'
hidden
'
);
var
versionModel
=
this
.
collection
.
get
(
revision
);
var
versionModel
=
this
.
collection
.
get
(
revision
);
versionModel
.
revert
({
versionModel
.
revert
({
success
:
function
()
{
success
:
function
()
{
// reset and re-fetch the updated collection
// reset and re-fetch the updated collection
self
.
$versionsContainer
.
empty
();
self
.
collection
.
setFileInfo
(
fileInfoModel
);
self
.
collection
.
setFileInfo
(
fileInfoModel
);
self
.
collection
.
fetch
();
self
.
collection
.
reset
([],
{
silent
:
true
});
self
.
collection
.
fetchNext
();
self
.
$el
.
find
(
'
.versions
'
).
removeClass
(
'
hidden
'
);
// update original model
// update original model
fileInfoModel
.
trigger
(
'
busy
'
,
fileInfoModel
,
false
);
fileInfoModel
.
trigger
(
'
busy
'
,
fileInfoModel
,
false
);
...
@@ -157,7 +163,7 @@
...
@@ -157,7 +163,7 @@
if
(
fileInfo
)
{
if
(
fileInfo
)
{
this
.
render
();
this
.
render
();
this
.
collection
.
setFileInfo
(
fileInfo
);
this
.
collection
.
setFileInfo
(
fileInfo
);
this
.
collection
.
reset
({
silent
:
true
});
this
.
collection
.
reset
(
[],
{
silent
:
true
});
this
.
nextPage
();
this
.
nextPage
();
}
else
{
}
else
{
this
.
render
();
this
.
render
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment