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
d04a91df
Commit
d04a91df
authored
Apr 10, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix refactored tabbed menu
parent
f0b11fe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
righthand-panel.js
src/app/panels/righthand-panel.js
+2
-3
tabbed-menu.js
src/app/tabs/tabbed-menu.js
+4
-3
No files found.
src/app/panels/righthand-panel.js
View file @
d04a91df
...
...
@@ -37,9 +37,8 @@ function RighthandPanel (appAPI = {}, events = {}, opts = {}) {
</div>
</div>
`
appAPI
.
switchTab
=
(
tabClass
)
=>
{
this
.
event
.
trigger
(
'switchTab'
,
[
tabClass
])
}
// selectTabByClassName
appAPI
.
switchTab
=
tabClass
=>
self
.
_view
.
tabbedMenu
.
selectTabByClassName
(
tabClass
)
events
.
rhp
=
self
.
event
...
...
src/app/tabs/tabbed-menu.js
View file @
d04a91df
...
...
@@ -2,6 +2,7 @@ var yo = require('yo-yo')
var
csjs
=
require
(
'csjs-inject'
)
var
remixLib
=
require
(
'remix-lib'
)
var
helper
=
require
(
'../../lib/helper'
)
var
styles
=
require
(
'../ui/styles-guide/theme-chooser'
).
chooser
()
var
EventManager
=
remixLib
.
EventManager
...
...
@@ -10,11 +11,10 @@ module.exports = class TabbedMenu {
constructor
(
api
=
{},
events
=
{},
opts
=
{})
{
const
self
=
this
self
.
event
=
new
EventManager
()
self
.
_opts
=
opts
self
.
_api
=
api
self
.
_events
=
events
self
.
_view
=
{
el
:
null
,
viewport
:
null
,
tabs
:
{},
contents
:
{}
}
self
.
data
=
{}
self
.
_components
=
{}
}
render
()
{
const
self
=
this
...
...
@@ -33,6 +33,7 @@ module.exports = class TabbedMenu {
}
addTab
(
title
,
cssClass
,
content
)
{
const
self
=
this
if
(
helper
.
checkSpecialChars
(
title
))
return
if
(
self
.
_view
.
contents
[
title
]
||
self
.
_view
.
tabs
[
title
])
throw
new
Error
(
'tab already exists'
)
self
.
_view
.
contents
[
title
]
=
content
self
.
_view
.
tabs
[
title
]
=
yo
`<li class="
${
css
.
options
}
${
cssClass
}
" onclick=
${
function
(
ev
)
{
self
.
selectTab
(
this
)
}
} title=
${
title
}
>
${
title
}
</li>`
...
...
@@ -43,7 +44,7 @@ module.exports = class TabbedMenu {
const
self
=
this
self
.
selectTab
(
self
.
_view
.
tabs
[
title
])
}
s
witchTab
(
tabClass
)
{
s
electTabByClassName
(
tabClass
)
{
const
self
=
this
self
.
selectTab
(
self
.
_view
.
el
.
querySelector
(
`li.
${
tabClass
}
`
))
}
...
...
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