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
a5d0d86d
Commit
a5d0d86d
authored
Feb 19, 2019
by
Iuri Matias
Committed by
yann300
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused tabbed menu files
parent
b3fdafee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
126 deletions
+0
-126
tabbed-menu-styles.js
src/app/tabs/styles/tabbed-menu-styles.js
+0
-36
tabbed-menu.js
src/app/tabs/tabbed-menu.js
+0
-90
No files found.
src/app/tabs/styles/tabbed-menu-styles.js
deleted
100644 → 0
View file @
b3fdafee
const
csjs
=
require
(
'csjs-inject'
)
const
css
=
csjs
`
.menu {
display: flex;
list-style: none;
margin: 0;
padding: 0;
}
.active {
}
.options {
float: left;
padding-top: 0.7em;
min-width: 60px;
font-size: 0.9em;
cursor: pointer;
font-size: 1em;
text-align: center;
}
.optionViews {
overflow: scroll;
height: 100%;
}
.optionViews > div {
display: none;
}
.optionViews .pre {
word-wrap: break-word;
border-radius: 3px;
display: inline-block;
padding: 0 0.6em;
}
`
module
.
exports
=
css
src/app/tabs/tabbed-menu.js
deleted
100644 → 0
View file @
b3fdafee
var
yo
=
require
(
'yo-yo'
)
var
css
=
require
(
'./styles/tabbed-menu-styles'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
helper
=
require
(
'../../lib/helper'
)
var
EventManager
=
require
(
'../../lib/events'
)
class
TabbedMenu
{
constructor
(
localRegistry
)
{
const
self
=
this
self
.
event
=
new
EventManager
()
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_deps
=
{
app
:
self
.
_components
.
registry
.
get
(
'app'
).
api
}
self
.
_view
=
{
el
:
null
,
viewport
:
null
,
tabs
:
{},
contents
:
{}
}
}
render
()
{
const
self
=
this
if
(
self
.
_view
.
el
)
return
self
.
_view
.
el
self
.
_view
.
el
=
yo
`<ul class=
${
css
.
menu
}
>
${
Object
.
values
(
self
.
_view
.
tabs
)}
</ul>`
return
self
.
_view
.
el
}
renderViewport
()
{
const
self
=
this
if
(
self
.
_view
.
viewport
)
return
self
.
_view
.
viewport
self
.
_view
.
viewport
=
yo
`
<div id="optionViews" class=
${
css
.
optionViews
}
>
${
Object
.
values
(
self
.
_view
.
contents
)}
</div>`
return
self
.
_view
.
viewport
}
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>`
if
(
self
.
_view
.
el
)
self
.
_view
.
el
.
appendChild
(
self
.
_view
.
tabs
[
title
])
if
(
self
.
_view
.
viewport
)
self
.
_view
.
viewport
.
appendChild
(
self
.
_view
.
contents
[
title
])
}
removeTabByTitle
(
title
)
{
const
self
=
this
if
(
self
.
_view
.
tabs
[
title
])
{
self
.
_view
.
tabs
[
title
].
parentNode
.
removeChild
(
self
.
_view
.
tabs
[
title
])
}
if
(
self
.
_view
.
contents
[
title
])
{
self
.
_view
.
contents
[
title
].
parentNode
.
removeChild
(
self
.
_view
.
contents
[
title
])
}
delete
self
.
_view
.
contents
[
title
]
delete
self
.
_view
.
tabs
[
title
]
}
getTabByClass
(
tabClass
)
{
const
self
=
this
return
self
.
_view
.
el
.
querySelector
(
`li.
${
tabClass
}
`
)
}
updateTabTitle
(
tabClass
,
title
)
{
const
self
=
this
var
tab
=
self
.
getTabByClass
(
tabClass
)
if
(
tab
)
tab
.
innerHTML
=
title
}
selectTabByTitle
(
title
)
{
const
self
=
this
self
.
selectTab
(
self
.
_view
.
tabs
[
title
])
}
selectTabByClassName
(
tabClass
)
{
const
self
=
this
var
tab
=
self
.
getTabByClass
(
tabClass
)
if
(
tab
)
self
.
selectTab
(
tab
)
return
tab
}
selectTab
(
el
)
{
const
self
=
this
if
(
!
el
.
classList
.
contains
(
css
.
active
))
{
var
nodes
=
Object
.
values
(
self
.
_view
.
tabs
)
for
(
var
i
=
0
;
i
<
nodes
.
length
;
++
i
)
{
nodes
[
i
].
classList
.
remove
(
css
.
active
)
self
.
_view
.
contents
[
nodes
[
i
].
getAttribute
(
'title'
)].
style
.
display
=
'none'
}
}
var
title
=
el
.
getAttribute
(
'title'
)
self
.
_view
.
contents
[
el
.
getAttribute
(
'title'
)].
style
.
display
=
'block'
el
.
classList
.
add
(
css
.
active
)
self
.
_deps
.
app
.
event
.
trigger
(
'tabChanged'
,
[
title
])
}
}
module
.
exports
=
TabbedMenu
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