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
48f5a791
Unverified
Commit
48f5a791
authored
Nov 02, 2020
by
David Disu
Committed by
GitHub
Nov 02, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #536 from ethereum/title-tab
Display least path difference in title of tabs
parents
2823b1f0
690a86a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
tab-proxy.js
apps/remix-ide/src/app/panels/tab-proxy.js
+47
-2
No files found.
apps/remix-ide/src/app/panels/tab-proxy.js
View file @
48f5a791
...
@@ -14,6 +14,7 @@ export class TabProxy {
...
@@ -14,6 +14,7 @@ export class TabProxy {
this
.
data
=
{}
this
.
data
=
{}
this
.
_view
=
{}
this
.
_view
=
{}
this
.
_handlers
=
{}
this
.
_handlers
=
{}
this
.
loadedTabs
=
[]
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
(
theme
)
=>
{
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
on
(
'themeChanged'
,
(
theme
)
=>
{
// update invert for all icons
// update invert for all icons
...
@@ -136,9 +137,52 @@ export class TabProxy {
...
@@ -136,9 +137,52 @@ export class TabProxy {
if
(
this
.
_handlers
[
name
])
return
if
(
this
.
_handlers
[
name
])
return
var
slash
=
name
.
split
(
'/'
)
var
slash
=
name
.
split
(
'/'
)
if
(
!
title
)
{
const
tabPath
=
slash
.
reverse
()
title
=
name
.
indexOf
(
'/'
)
!==
-
1
?
slash
[
slash
.
length
-
1
]
:
name
const
tempTitle
=
[]
for
(
let
i
=
0
;
i
<
tabPath
.
length
;
i
++
)
{
tempTitle
.
push
(
tabPath
[
i
])
const
formatPath
=
[...
tempTitle
].
reverse
()
if
(
!
title
)
{
const
index
=
this
.
loadedTabs
.
findIndex
(({
title
})
=>
title
===
formatPath
.
join
(
'/'
))
if
(
index
===
-
1
)
{
title
=
formatPath
.
join
(
'/'
)
const
titleLength
=
formatPath
.
length
this
.
loadedTabs
.
push
({
name
,
title
})
formatPath
.
shift
()
if
(
formatPath
.
length
>
0
)
{
const
duplicateTabName
=
this
.
loadedTabs
.
find
(({
title
})
=>
title
===
formatPath
.
join
(
'/'
)).
name
const
duplicateTabPath
=
duplicateTabName
.
split
(
'/'
)
const
duplicateTabFormatPath
=
[...
duplicateTabPath
].
reverse
()
const
duplicateTabTitle
=
duplicateTabFormatPath
.
slice
(
0
,
titleLength
).
reverse
().
join
(
'/'
)
this
.
loadedTabs
.
push
({
name
:
duplicateTabName
,
title
:
duplicateTabTitle
})
this
.
_view
.
filetabs
.
removeTab
(
duplicateTabName
)
this
.
_view
.
filetabs
.
addTab
({
id
:
duplicateTabName
,
title
:
duplicateTabTitle
,
icon
,
tooltip
:
duplicateTabName
})
}
break
;
}
}
else
{
this
.
loadedTabs
.
push
({
name
,
title
})
}
}
}
this
.
_view
.
filetabs
.
addTab
({
this
.
_view
.
filetabs
.
addTab
({
id
:
name
,
id
:
name
,
title
,
title
,
...
@@ -153,6 +197,7 @@ export class TabProxy {
...
@@ -153,6 +197,7 @@ export class TabProxy {
this
.
_view
.
filetabs
.
removeTab
(
name
)
this
.
_view
.
filetabs
.
removeTab
(
name
)
delete
this
.
_handlers
[
name
]
delete
this
.
_handlers
[
name
]
this
.
switchToActiveTab
()
this
.
switchToActiveTab
()
this
.
loadedTabs
=
this
.
loadedTabs
.
filter
(
tab
=>
tab
.
name
!==
name
)
}
}
addHandler
(
type
,
fn
)
{
addHandler
(
type
,
fn
)
{
...
...
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