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
0bbe9dce
Commit
0bbe9dce
authored
Jan 16, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix updating view
parent
25614ec1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+15
-16
No files found.
src/app/components/plugin-manager-component.js
View file @
0bbe9dce
...
...
@@ -31,8 +31,8 @@ class PluginManagerComponent {
setStore
(
store
)
{
this
.
store
=
store
this
.
store
.
event
.
on
(
'activate'
,
(
name
)
=>
{
this
.
views
.
items
[
name
]
?
this
.
views
.
items
[
name
].
querySelector
(
'button'
).
innerHTML
=
'deactivate'
:
null
})
this
.
store
.
event
.
on
(
'deactivate'
,
(
name
)
=>
{
this
.
views
.
items
[
name
]
?
this
.
views
.
items
[
name
].
querySelector
(
'button'
).
innerHTML
=
'activate'
:
null
})
this
.
store
.
event
.
on
(
'activate'
,
(
name
)
=>
{
this
.
reRender
()
})
this
.
store
.
event
.
on
(
'deactivate'
,
(
name
)
=>
{
this
.
reRender
()
})
}
render
()
{
...
...
@@ -46,7 +46,7 @@ class PluginManagerComponent {
<h3>Inactive Modules</h3>
</div>
`
this
.
views
.
root
=
yo
`
var
rootView
=
yo
`
<div id='pluginManager' class=
${
css
.
plugins_settings
}
>
<h2>Plugin Manager</h2>
<input placeholder="Search loaded plugins">
...
...
@@ -69,12 +69,14 @@ class PluginManagerComponent {
var
modulesAll
=
this
.
store
.
getAll
()
modulesAll
.
sort
()
modulesAll
.
forEach
((
mod
)
=>
{
if
(
!
(
modulesActive
.
includes
(
mod
))
)
{
if
(
!
modulesActive
.
includes
(
mod
)
)
{
this
.
views
.
inactiveMods
.
appendChild
(
this
.
renderItem
(
mod
.
profile
.
name
))
}
})
return
this
.
views
.
root
if
(
!
this
.
views
.
root
)
{
this
.
views
.
root
=
rootView
}
return
rootView
}
renderItem
(
item
)
{
...
...
@@ -82,13 +84,11 @@ class PluginManagerComponent {
const
mod
=
this
.
store
.
getOne
(
item
)
if
(
!
mod
)
return
let
action
=
async
()
=>
{
let
action
=
()
=>
{
if
(
this
.
store
.
isActive
(
item
))
{
await
this
.
appManager
.
deactivateOne
(
item
)
this
.
reRender
()
this
.
appManager
.
deactivateOne
(
item
)
}
else
{
await
this
.
appManager
.
activateOne
(
item
)
this
.
reRender
()
this
.
appManager
.
activateOne
(
item
)
}
}
...
...
@@ -103,14 +103,13 @@ class PluginManagerComponent {
${
ctrBtns
}
</div>
`
return
this
.
views
.
items
[
item
]
}
reRender
(
item
)
{
document
.
getElementById
(
'pluginManager'
).
innerHTML
=
''
let
piMan
=
this
.
render
(
)
document
.
getElementById
(
'pluginManager'
).
appendChild
(
piMan
)
reRender
()
{
if
(
this
.
views
.
root
)
{
yo
.
update
(
this
.
views
.
root
,
this
.
render
()
)
}
}
}
...
...
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