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
5f05fb2a
Commit
5f05fb2a
authored
Jul 22, 2019
by
Grandschtroumpf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use emit function from plugin
parent
4abd9f35
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
side-panel.js
src/app/components/side-panel.js
+6
-0
vertical-icons.js
src/app/components/vertical-icons.js
+4
-0
fileManager.js
src/app/files/fileManager.js
+14
-0
theme-module.js
src/app/tabs/theme-module.js
+2
-0
framingService.js
src/framingService.js
+1
-0
No files found.
src/app/components/side-panel.js
View file @
5f05fb2a
...
@@ -73,16 +73,22 @@ export class SidePanel extends AbstractPanel {
...
@@ -73,16 +73,22 @@ export class SidePanel extends AbstractPanel {
verticalIcons
.
events
.
on
(
'toggleContent'
,
(
name
)
=>
{
verticalIcons
.
events
.
on
(
'toggleContent'
,
(
name
)
=>
{
if
(
!
this
.
contents
[
name
])
return
if
(
!
this
.
contents
[
name
])
return
if
(
this
.
active
===
name
)
{
if
(
this
.
active
===
name
)
{
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'toggle'
,
name
)
this
.
events
.
emit
(
'toggle'
,
name
)
this
.
events
.
emit
(
'toggle'
,
name
)
return
return
}
}
this
.
showContent
(
name
)
this
.
showContent
(
name
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'showing'
,
name
)
this
.
events
.
emit
(
'showing'
,
name
)
this
.
events
.
emit
(
'showing'
,
name
)
})
})
// Force opening
// Force opening
verticalIcons
.
events
.
on
(
'showContent'
,
(
name
)
=>
{
verticalIcons
.
events
.
on
(
'showContent'
,
(
name
)
=>
{
if
(
!
this
.
contents
[
name
])
return
if
(
!
this
.
contents
[
name
])
return
this
.
showContent
(
name
)
this
.
showContent
(
name
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'showing'
,
name
)
this
.
events
.
emit
(
'showing'
,
name
)
this
.
events
.
emit
(
'showing'
,
name
)
})
})
}
}
...
...
src/app/components/vertical-icons.js
View file @
5f05fb2a
...
@@ -187,6 +187,8 @@ export class VerticalIcons extends Plugin {
...
@@ -187,6 +187,8 @@ export class VerticalIcons extends Plugin {
*/
*/
select
(
name
)
{
select
(
name
)
{
this
.
updateActivations
(
name
)
this
.
updateActivations
(
name
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'showContent'
,
name
)
this
.
events
.
emit
(
'showContent'
,
name
)
this
.
events
.
emit
(
'showContent'
,
name
)
}
}
...
@@ -196,6 +198,8 @@ export class VerticalIcons extends Plugin {
...
@@ -196,6 +198,8 @@ export class VerticalIcons extends Plugin {
*/
*/
toggle
(
name
)
{
toggle
(
name
)
{
this
.
updateActivations
(
name
)
this
.
updateActivations
(
name
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'toggleContent'
,
name
)
this
.
events
.
emit
(
'toggleContent'
,
name
)
this
.
events
.
emit
(
'toggleContent'
,
name
)
}
}
...
...
src/app/files/fileManager.js
View file @
5f05fb2a
...
@@ -85,6 +85,8 @@ class FileManager extends Plugin {
...
@@ -85,6 +85,8 @@ class FileManager extends Plugin {
this
.
switchFile
(
newFocus
)
this
.
switchFile
(
newFocus
)
}
}
}
}
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'fileRenamed'
,
oldName
,
newName
)
this
.
events
.
emit
(
'fileRenamed'
,
oldName
,
newName
)
this
.
events
.
emit
(
'fileRenamed'
,
oldName
,
newName
)
}
}
...
@@ -104,8 +106,12 @@ class FileManager extends Plugin {
...
@@ -104,8 +106,12 @@ class FileManager extends Plugin {
delete
this
.
openedFiles
[
name
]
delete
this
.
openedFiles
[
name
]
if
(
!
Object
.
keys
(
this
.
openedFiles
).
length
)
{
if
(
!
Object
.
keys
(
this
.
openedFiles
).
length
)
{
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
}
}
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'fileClosed'
,
name
)
this
.
events
.
emit
(
'fileClosed'
,
name
)
this
.
events
.
emit
(
'fileClosed'
,
name
)
}
}
...
@@ -234,6 +240,8 @@ class FileManager extends Plugin {
...
@@ -234,6 +240,8 @@ class FileManager extends Plugin {
}
}
this
.
editor
.
discard
(
path
)
this
.
editor
.
discard
(
path
)
delete
this
.
openedFiles
[
path
]
delete
this
.
openedFiles
[
path
]
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'fileRemoved'
,
path
)
this
.
events
.
emit
(
'fileRemoved'
,
path
)
this
.
events
.
emit
(
'fileRemoved'
,
path
)
this
.
switchFile
()
this
.
switchFile
()
}
}
...
@@ -241,6 +249,8 @@ class FileManager extends Plugin {
...
@@ -241,6 +249,8 @@ class FileManager extends Plugin {
unselectCurrentFile
()
{
unselectCurrentFile
()
{
this
.
saveCurrentFile
()
this
.
saveCurrentFile
()
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
}
}
...
@@ -258,6 +268,8 @@ class FileManager extends Plugin {
...
@@ -258,6 +268,8 @@ class FileManager extends Plugin {
}
else
{
}
else
{
this
.
editor
.
open
(
file
,
content
)
this
.
editor
.
open
(
file
,
content
)
}
}
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'currentFileChanged'
,
file
)
this
.
events
.
emit
(
'currentFileChanged'
,
file
)
this
.
events
.
emit
(
'currentFileChanged'
,
file
)
}
}
})
})
...
@@ -271,6 +283,8 @@ class FileManager extends Plugin {
...
@@ -271,6 +283,8 @@ class FileManager extends Plugin {
if
(
fileList
.
length
)
{
if
(
fileList
.
length
)
{
_switchFile
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
_switchFile
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
}
else
{
}
else
{
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
this
.
events
.
emit
(
'noFileSelected'
)
}
}
})
})
...
...
src/app/tabs/theme-module.js
View file @
5f05fb2a
...
@@ -60,6 +60,8 @@ export class ThemeModule extends Plugin {
...
@@ -60,6 +60,8 @@ export class ThemeModule extends Plugin {
document
.
getElementById
(
'theme-link'
).
setAttribute
(
'href'
,
nextTheme
.
url
)
document
.
getElementById
(
'theme-link'
).
setAttribute
(
'href'
,
nextTheme
.
url
)
document
.
documentElement
.
style
.
setProperty
(
'--theme'
,
nextTheme
.
quality
)
document
.
documentElement
.
style
.
setProperty
(
'--theme'
,
nextTheme
.
quality
)
if
(
themeName
)
this
.
active
=
themeName
if
(
themeName
)
this
.
active
=
themeName
// TODO: Only keep `this.emit` (issue#2210)
this
.
emit
(
'themeChanged'
,
nextTheme
)
this
.
events
.
emit
(
'themeChanged'
,
nextTheme
)
this
.
events
.
emit
(
'themeChanged'
,
nextTheme
)
}
}
}
}
src/framingService.js
View file @
5f05fb2a
...
@@ -10,6 +10,7 @@ export class FramingService {
...
@@ -10,6 +10,7 @@ export class FramingService {
start
()
{
start
()
{
this
.
sidePanel
.
events
.
on
(
'toggle'
,
()
=>
{
this
.
sidePanel
.
events
.
on
(
'toggle'
,
()
=>
{
console
.
log
(
'Toggled'
)
this
.
resizeFeature
.
panel1
.
clientWidth
!==
0
?
this
.
resizeFeature
.
minimize
()
:
this
.
resizeFeature
.
maximise
()
this
.
resizeFeature
.
panel1
.
clientWidth
!==
0
?
this
.
resizeFeature
.
minimize
()
:
this
.
resizeFeature
.
maximise
()
})
})
this
.
sidePanel
.
events
.
on
(
'showing'
,
()
=>
{
this
.
sidePanel
.
events
.
on
(
'showing'
,
()
=>
{
...
...
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