Skip to content

Commit

Permalink
Workaround to avoid restoring the version before collabora is ready
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Mar 9, 2021
1 parent bbf3789 commit 6c7ad2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/view/FilesAppIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,25 @@ export default {
avatardiv.append(popover)
},

_originalOnClickRevertVersion: null,

addVersionSidebarEvents() {
const versionTabView = OCA.Files.App.fileList._detailsView._tabViews.find(t => t.el.id === 'versionsTabView')
if (versionTabView) {
this._originalOnClickRevertVersion = versionTabView._onClickRevertVersion
OCA.Files.App.fileList._detailsView._tabViews.find(t => t.el.id === 'versionsTabView')._onClickRevertVersion = () => {}
}
$(document.querySelector('#content')).on('click.revisions', '#app-sidebar .preview-container', this.showVersionPreview.bind(this))
$(document.querySelector('#content')).on('click.revisions', '#app-sidebar .downloadVersion', this.showVersionPreview.bind(this))
$(document.querySelector('#content')).on('mousedown.revisions', '#app-sidebar .revertVersion', this.restoreVersion.bind(this))
$(document.querySelector('#content')).on('click.revisionsTab', '#app-sidebar [data-tabid=versionsTabView]', this.addCurrentVersion.bind(this))
},

removeVersionSidebarEvents() {
const versionTabView = OCA.Files.App.fileList._detailsView._tabViews.find(t => t.el.id === 'versionsTabView')
if (versionTabView) {
versionTabView._onClickRevertVersion = this._originalOnClickRevertVersion
}
$(document.querySelector('#content')).off('click.revisions')
$(document.querySelector('#content')).off('click.revisions')
$(document.querySelector('#content')).off('mousedown.revisions')
Expand Down

0 comments on commit 6c7ad2c

Please sign in to comment.