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
cca207fe
Unverified
Commit
cca207fe
authored
Apr 08, 2019
by
yann300
Committed by
GitHub
Apr 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1811 from ethereum/tabChanged
Switch tab shortkey
parents
7bb6393b
e59e9ed2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
editor-panel.js
src/app/panels/editor-panel.js
+5
-0
tab-proxy.js
src/app/panels/tab-proxy.js
+32
-1
No files found.
src/app/panels/editor-panel.js
View file @
cca207fe
...
...
@@ -190,6 +190,11 @@ class EditorPanel {
`
// INIT
self
.
_adjustLayout
(
'top'
,
self
.
data
.
_layout
.
top
.
offset
)
document
.
addEventListener
(
'keydown'
,
(
e
)
=>
{
if
(
e
.
altKey
&&
e
.
keyCode
===
84
)
self
.
tabProxy
.
switchNextTab
()
})
return
self
.
_view
.
el
}
registerCommand
(
name
,
command
,
opts
)
{
...
...
src/app/panels/tab-proxy.js
View file @
cca207fe
...
...
@@ -10,7 +10,6 @@ export class TabProxy {
this
.
fileManager
=
fileManager
this
.
appManager
=
appManager
this
.
editor
=
editor
this
.
entities
=
{}
this
.
data
=
{}
this
.
_view
=
{}
this
.
_handlers
=
{}
...
...
@@ -61,6 +60,7 @@ export class TabProxy {
this
.
appManager
.
deactivateOne
(
name
)
}
)
this
.
switchTab
(
name
)
}
})
...
...
@@ -69,6 +69,37 @@ export class TabProxy {
})
}
switchTab
(
tabName
)
{
if
(
this
.
_handlers
[
tabName
])
{
this
.
_handlers
[
tabName
].
switchTo
()
this
.
_view
.
filetabs
.
activateTab
(
tabName
)
}
}
switchNextTab
()
{
const
active
=
this
.
_view
.
filetabs
.
active
if
(
active
&&
this
.
_handlers
[
active
])
{
const
handlers
=
Object
.
keys
(
this
.
_handlers
)
let
i
=
handlers
.
indexOf
(
active
)
if
(
i
>=
0
)
{
i
=
handlers
[
i
+
1
]
?
i
+
1
:
0
this
.
switchTab
(
handlers
[
i
])
}
}
}
switchPreviousTab
()
{
const
active
=
this
.
_view
.
filetabs
.
active
if
(
active
&&
this
.
_handlers
[
active
])
{
const
handlers
=
Object
.
keys
(
this
.
_handlers
)
let
i
=
handlers
.
indexOf
(
active
)
if
(
i
>=
0
)
{
i
=
handlers
[
i
-
1
]
?
i
-
1
:
handlers
.
length
-
1
this
.
switchTab
(
handlers
[
i
])
}
}
}
addTab
(
name
,
switchTo
,
close
,
kind
)
{
var
slash
=
name
.
split
(
'/'
)
let
title
=
name
.
indexOf
(
'/'
)
!==
-
1
?
slash
[
slash
.
length
-
1
]
:
name
...
...
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