Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
6201b0b5
Unverified
Commit
6201b0b5
authored
5 years ago
by
John Molakvoæ
Browse files
Options
Downloads
Patches
Plain Diff
Allow to await the sidebar
Signed-off-by:
John Molakvoæ (skjnldsv)
<
skjnldsv@protonmail.com
>
parent
cbe2bafc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/files/src/services/Sidebar.js
+0
-10
0 additions, 10 deletions
apps/files/src/services/Sidebar.js
apps/files/src/sidebar.js
+3
-3
3 additions, 3 deletions
apps/files/src/sidebar.js
apps/files/src/views/Sidebar.vue
+39
-30
39 additions, 30 deletions
apps/files/src/views/Sidebar.vue
with
42 additions
and
43 deletions
apps/files/src/services/Sidebar.js
+
0
−
10
View file @
6201b0b5
...
...
@@ -75,16 +75,6 @@ export default class Sidebar {
return
false
}
/**
* Open the sidebar for the given file
*
* @memberof Sidebar
* @param {string} path the file path to load
*/
open
(
path
)
{
this
.
#state
.
file
=
path
}
/**
* Close the sidebar
*
...
...
This diff is collapsed.
Click to expand it.
apps/files/src/sidebar.js
+
3
−
3
View file @
6201b0b5
...
...
@@ -51,10 +51,10 @@ window.addEventListener('DOMContentLoaded', () => {
}
// Init vue app
const
AppSidebar
=
new
Vue
({
// eslint-disable-next-line vue/match-component-file-name
const
View
=
Vue
.
extend
(
SidebarView
)
const
AppSidebar
=
new
View
({
name
:
'
SidebarRoot
'
,
render
:
h
=>
h
(
SidebarView
),
})
AppSidebar
.
$mount
(
'
#app-sidebar
'
)
window
.
OCA
.
Files
.
Sidebar
.
open
=
AppSidebar
.
open
})
This diff is collapsed.
Click to expand it.
apps/files/src/views/Sidebar.vue
+
39
−
30
View file @
6201b0b5
...
...
@@ -237,35 +237,6 @@ export default {
isSystemTagsEnabled
()
{
return
OCA
&&
'
SystemTags
'
in
OCA
}
},
watch
:
{
// update the sidebar data
async
file
(
curr
,
prev
)
{
this
.
resetData
()
if
(
curr
&&
curr
.
trim
()
!==
''
)
{
try
{
this
.
fileInfo
=
await
FileInfo
(
this
.
davPath
)
// adding this as fallback because other apps expect it
this
.
fileInfo
.
dir
=
this
.
file
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
)
// DEPRECATED legacy views
// TODO: remove
this
.
views
.
forEach
(
view
=>
{
view
.
setFileInfo
(
this
.
fileInfo
)
})
this
.
$nextTick
(()
=>
{
if
(
this
.
$refs
.
sidebar
)
{
this
.
$refs
.
sidebar
.
updateTabs
()
}
})
}
catch
(
error
)
{
this
.
error
=
t
(
'
files
'
,
'
Error while loading the file data
'
)
console
.
error
(
'
Error while loading the file data
'
,
error
)
}
}
},
},
...
...
@@ -405,7 +376,45 @@ export default {
if
(
OCA
.
SystemTags
&&
OCA
.
SystemTags
.
View
)
{
OCA
.
SystemTags
.
View
.
toggle
()
}
}
},
/**
* Open the sidebar for the given file
*
* @memberof Sidebar
* @param {string} path the file path to load
*/
async
open
(
path
)
{
// update current opened file
this
.
Sidebar
.
file
=
path
// reset previous data
this
.
resetData
()
if
(
path
&&
path
.
trim
()
!==
''
)
{
try
{
this
.
fileInfo
=
await
FileInfo
(
this
.
davPath
)
// adding this as fallback because other apps expect it
this
.
fileInfo
.
dir
=
this
.
file
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
)
// DEPRECATED legacy views
// TODO: remove
this
.
views
.
forEach
(
view
=>
{
view
.
setFileInfo
(
this
.
fileInfo
)
})
this
.
$nextTick
(()
=>
{
if
(
this
.
$refs
.
sidebar
)
{
this
.
$refs
.
sidebar
.
updateTabs
()
}
})
}
catch
(
error
)
{
this
.
error
=
t
(
'
files
'
,
'
Error while loading the file data
'
)
console
.
error
(
'
Error while loading the file data
'
,
error
)
throw
new
Error
(
error
)
}
}
},
},
}
</
script
>
...
...
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