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
afb18496
Commit
afb18496
authored
Jun 07, 2018
by
serapath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testTab: refactor to class
parent
9f5e8f48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
test-tab.js
src/app/tabs/test-tab.js
+11
-13
No files found.
src/app/tabs/test-tab.js
View file @
afb18496
...
@@ -3,13 +3,8 @@ var async = require('async')
...
@@ -3,13 +3,8 @@ var async = require('async')
var
css
=
require
(
'./styles/test-tab-styles'
)
var
css
=
require
(
'./styles/test-tab-styles'
)
var
remixTests
=
require
(
'remix-tests'
)
var
remixTests
=
require
(
'remix-tests'
)
function
append
(
container
,
txt
)
{
module
.
exports
=
class
TestTab
{
let
child
=
yo
`<div>
${
txt
}
</div>`
constructor
(
api
=
{},
events
=
{},
opts
=
{})
{
container
.
appendChild
(
child
)
}
const
prototype
=
{
constructor
:
function
testTab
(
api
=
{},
events
=
{},
opts
=
{})
{
const
self
=
this
const
self
=
this
self
.
_opts
=
opts
self
.
_opts
=
opts
self
.
_api
=
api
self
.
_api
=
api
...
@@ -18,21 +13,26 @@ const prototype = {
...
@@ -18,21 +13,26 @@ const prototype = {
self
.
_components
=
{}
self
.
_components
=
{}
self
.
data
=
{}
self
.
data
=
{}
self
.
_view
.
el
=
prototype
.
render
()
self
.
_view
.
el
=
self
.
render
()
events
.
app
.
register
(
'tabChanged'
,
tabName
=>
{
events
.
app
.
register
(
'tabChanged'
,
tabName
=>
{
if
(
tabName
!==
'test'
)
return
if
(
tabName
!==
'test'
)
return
yo
.
update
(
self
.
_view
.
el
,
prototype
.
render
())
yo
.
update
(
self
.
_view
.
el
,
self
.
render
())
self
.
_view
.
el
.
style
.
display
=
'block'
self
.
_view
.
el
.
style
.
display
=
'block'
})
})
return
{
render
()
{
return
self
.
_view
.
el
}
}
return
{
render
()
{
return
self
.
_view
.
el
}
}
}
,
}
render
:
function
render
()
{
render
()
{
const
self
=
this
const
self
=
this
const
api
=
self
.
_api
const
api
=
self
.
_api
var
container
=
yo
`<div class="tests" id="tests"></div>`
var
container
=
yo
`<div class="tests" id="tests"></div>`
function
append
(
container
,
txt
)
{
let
child
=
yo
`<div>
${
txt
}
</div>`
container
.
appendChild
(
child
)
}
let
testCallback
=
function
(
result
)
{
let
testCallback
=
function
(
result
)
{
if
(
result
.
type
===
'contract'
)
{
if
(
result
.
type
===
'contract'
)
{
append
(
container
,
'
\
n '
+
result
.
value
)
append
(
container
,
'
\
n '
+
result
.
value
)
...
@@ -109,5 +109,3 @@ const prototype = {
...
@@ -109,5 +109,3 @@ const prototype = {
return
el
return
el
}
}
}
}
prototype
.
constructor
.
prototype
=
prototype
module
.
exports
=
prototype
.
constructor
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