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
9f5e8f48
Commit
9f5e8f48
authored
Jun 07, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTab: refactor to prepare for class
parent
252840fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
test-tab.js
src/app/tabs/test-tab.js
+18
-12
No files found.
src/app/tabs/test-tab.js
View file @
9f5e8f48
...
...
@@ -10,22 +10,27 @@ function append (container, txt) {
const
prototype
=
{
constructor
:
function
testTab
(
api
=
{},
events
=
{},
opts
=
{})
{
let
el
=
prototype
.
render
(
api
)
let
gitterIsLoaded
=
false
const
self
=
this
self
.
_opts
=
opts
self
.
_api
=
api
self
.
_events
=
events
self
.
_view
=
{
el
:
null
}
self
.
_components
=
{}
self
.
data
=
{}
events
.
app
.
register
(
'tabChanged'
,
(
tabName
)
=>
{
if
(
tabName
!==
'test'
||
gitterIsLoaded
)
{
return
}
self
.
_view
.
el
=
prototype
.
render
()
yo
.
update
(
el
,
prototype
.
render
(
api
))
el
.
style
.
display
=
'block'
gitterIsLoaded
=
true
events
.
app
.
register
(
'tabChanged'
,
tabName
=>
{
if
(
tabName
!==
'test'
)
return
yo
.
update
(
self
.
_view
.
el
,
prototype
.
render
())
self
.
_view
.
el
.
style
.
display
=
'block'
})
return
{
render
()
{
return
el
}
}
return
{
render
()
{
return
self
.
_view
.
el
}
}
},
render
:
function
render
(
api
)
{
render
:
function
render
()
{
const
self
=
this
const
api
=
self
.
_api
var
container
=
yo
`<div class="tests" id="tests"></div>`
let
testCallback
=
function
(
result
)
{
...
...
@@ -89,7 +94,7 @@ const prototype = {
})
}
return
yo
`
var
el
=
yo
`
<div class="
${
css
.
testTabView
}
"id="testView">
<div>
<div class="
${
css
.
infoBox
}
">
...
...
@@ -101,6 +106,7 @@ const prototype = {
</div>
</div>
`
return
el
}
}
prototype
.
constructor
.
prototype
=
prototype
...
...
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