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
bd07c525
Unverified
Commit
bd07c525
authored
Apr 12, 2021
by
yann300
Committed by
GitHub
Apr 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close all tabs when workspace changes (#1105)
fix
https://github.com/ethereum/remix-project/issues/989
parent
c592798c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
5 deletions
+19
-5
app.js
apps/remix-ide/src/app.js
+1
-1
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+9
-0
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+1
-1
tab-proxy.js
apps/remix-ide/src/app/panels/tab-proxy.js
+5
-0
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+3
-3
No files found.
apps/remix-ide/src/app.js
View file @
bd07c525
...
...
@@ -450,7 +450,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
await
appManager
.
activatePlugin
([
'contentImport'
,
'theme'
,
'editor'
,
'fileManager'
,
'compilerMetadata'
,
'compilerArtefacts'
,
'network'
,
'web3Provider'
,
'offsetToLineColumnConverter'
])
await
appManager
.
activatePlugin
([
'mainPanel'
,
'menuicons'
])
await
appManager
.
activatePlugin
([
'mainPanel'
,
'menuicons'
,
'tabs'
])
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'pluginManager'
,
'fileExplorers'
,
'settings'
,
'contextualListener'
,
'terminal'
,
'fetchAndCompile'
])
...
...
apps/remix-ide/src/app/files/fileManager.js
View file @
bd07c525
...
...
@@ -398,6 +398,15 @@ class FileManager extends Plugin {
return
this
.
_deps
.
config
.
get
(
'currentFile'
)
}
closeAllFiles
()
{
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'filesAllClosed'
)
this
.
events
.
emit
(
'filesAllClosed'
)
for
(
const
file
in
this
.
openedFiles
)
{
this
.
closeFile
(
file
)
}
}
closeFile
(
name
)
{
delete
this
.
openedFiles
[
name
]
if
(
!
Object
.
keys
(
this
.
openedFiles
).
length
)
{
...
...
apps/remix-ide/src/app/panels/file-panel.js
View file @
bd07c525
...
...
@@ -225,7 +225,7 @@ module.exports = class Filepanel extends ViewPlugin {
/** these are called by the react component, action is already finished whent it's called */
async
setWorkspace
(
workspace
)
{
this
.
_deps
.
fileManager
.
removeTabsOf
(
this
.
_deps
.
fileProviders
.
workspace
)
this
.
_deps
.
fileManager
.
closeAllFiles
(
)
if
(
workspace
.
isLocalhost
)
{
this
.
call
(
'manager'
,
'activatePlugin'
,
'remixd'
)
}
else
if
(
await
this
.
call
(
'manager'
,
'isActive'
,
'remixd'
))
{
...
...
apps/remix-ide/src/app/panels/tab-proxy.js
View file @
bd07c525
...
...
@@ -37,6 +37,11 @@ export class TabProxy extends Plugin {
this
.
updateImgStyles
()
})
fileManager
.
events
.
on
(
'filesAllClosed'
,
()
=>
{
this
.
call
(
'manager'
,
'activatePlugin'
,
'home'
)
this
.
_view
.
filetabs
.
active
=
'home'
})
fileManager
.
events
.
on
(
'fileRemoved'
,
(
name
)
=>
{
const
workspace
=
this
.
fileManager
.
currentWorkspace
()
...
...
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
bd07c525
...
...
@@ -223,7 +223,7 @@ export const Workspace = (props: WorkspaceProps) => {
}
const
setWorkspace
=
async
(
name
)
=>
{
props
.
setWorkspace
({
name
,
isLocalhost
:
name
===
LOCALHOST
})
await
props
.
setWorkspace
({
name
,
isLocalhost
:
name
===
LOCALHOST
})
if
(
name
===
LOCALHOST
)
{
props
.
workspace
.
clearWorkspace
()
}
else
if
(
name
===
NO_WORKSPACE
)
{
...
...
@@ -238,8 +238,8 @@ export const Workspace = (props: WorkspaceProps) => {
}
const
remixdExplorer
=
{
hide
:
()
=>
{
if
(
state
.
currentWorkspace
===
LOCALHOST
)
setWorkspace
(
NO_WORKSPACE
)
hide
:
async
()
=>
{
await
setWorkspace
(
NO_WORKSPACE
)
props
.
fileManager
.
setMode
(
'browser'
)
setState
(
prevState
=>
{
return
{
...
prevState
,
hideRemixdExplorer
:
true
,
loadingLocalhost
:
false
}
...
...
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