Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
32253882
Commit
32253882
authored
Mar 04, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fileexplorer selected file
parent
58c60897
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
file-explorer.js
src/app/files/file-explorer.js
+12
-15
No files found.
src/app/files/file-explorer.js
View file @
32253882
...
@@ -79,8 +79,8 @@ function fileExplorer (localRegistry, files) {
...
@@ -79,8 +79,8 @@ function fileExplorer (localRegistry, files) {
self
.
focusElement
=
self
.
treeView
.
labelAt
(
self
.
focusPath
)
self
.
focusElement
=
self
.
treeView
.
labelAt
(
self
.
focusPath
)
// TODO: here we update the selected file (it applicable)
// TODO: here we update the selected file (it applicable)
// cause we are refreshing the interface of the whole directory when there's a new file.
// cause we are refreshing the interface of the whole directory when there's a new file.
if
(
self
.
focusElement
&&
!
self
.
focusElement
.
classList
.
contains
(
'bg-
prim
ary'
))
{
if
(
self
.
focusElement
&&
!
self
.
focusElement
.
classList
.
contains
(
'bg-
second
ary'
))
{
self
.
focusElement
.
classList
.
add
(
'bg-
prim
ary'
)
self
.
focusElement
.
classList
.
add
(
'bg-
second
ary'
)
}
}
})
})
}
}
...
@@ -165,17 +165,7 @@ function fileExplorer (localRegistry, files) {
...
@@ -165,17 +165,7 @@ function fileExplorer (localRegistry, files) {
})
})
self
.
treeView
.
event
.
register
(
'leafClick'
,
function
(
key
,
data
,
label
)
{
self
.
treeView
.
event
.
register
(
'leafClick'
,
function
(
key
,
data
,
label
)
{
if
(
self
.
focusElement
)
{
self
.
events
.
trigger
(
'focus'
,
[
key
])
self
.
focusElement
.
classList
.
remove
(
'bg-secondary'
)
self
.
focusElement
=
null
self
.
focusPath
=
null
}
self
.
focusElement
=
self
.
treeView
.
labelAt
(
key
)
if
(
self
.
focusElement
)
{
self
.
focusElement
.
classList
.
add
(
'bg-secondary'
)
self
.
focusPath
=
key
self
.
events
.
trigger
(
'focus'
,
[
key
])
}
})
})
self
.
treeView
.
event
.
register
(
'nodeClick'
,
function
(
path
,
childrenContainer
)
{
self
.
treeView
.
event
.
register
(
'nodeClick'
,
function
(
path
,
childrenContainer
)
{
...
@@ -202,11 +192,18 @@ function fileExplorer (localRegistry, files) {
...
@@ -202,11 +192,18 @@ function fileExplorer (localRegistry, files) {
// register to main app, trigger when the current file in the editor changed
// register to main app, trigger when the current file in the editor changed
self
.
_deps
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
newFile
)
=>
{
self
.
_deps
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
newFile
)
=>
{
const
explorer
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
newFile
)
const
explorer
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
newFile
)
if
(
self
.
focusElement
&&
(
!
explorer
||
explorer
.
type
!==
files
.
type
)
&&
self
.
focusPath
!==
newFile
)
{
if
(
self
.
focusElement
&&
self
.
focusPath
!==
newFile
)
{
self
.
focusElement
.
classList
.
remove
(
'bg-
prim
ary'
)
self
.
focusElement
.
classList
.
remove
(
'bg-
second
ary'
)
self
.
focusElement
=
null
self
.
focusElement
=
null
self
.
focusPath
=
null
self
.
focusPath
=
null
}
}
if
(
explorer
&&
(
explorer
.
type
===
files
.
type
))
{
self
.
focusElement
=
self
.
treeView
.
labelAt
(
newFile
)
if
(
self
.
focusElement
)
{
self
.
focusElement
.
classList
.
add
(
'bg-secondary'
)
self
.
focusPath
=
newFile
}
}
})
})
var
textUnderEdit
=
null
var
textUnderEdit
=
null
...
...
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