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
c717c046
Commit
c717c046
authored
Oct 02, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui styling
parent
31361b4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
contextView.js
src/app/editor/contextView.js
+35
-7
No files found.
src/app/editor/contextView.js
View file @
c717c046
...
@@ -10,11 +10,28 @@ var css = csjs`
...
@@ -10,11 +10,28 @@ var css = csjs`
background-color :
${
styles
.
colors
.
backgroundBlue
}
;
background-color :
${
styles
.
colors
.
backgroundBlue
}
;
opacity : 0.8;
opacity : 0.8;
width : 20em;
width : 20em;
height :
5
em;
height :
6
em;
border-color : transparent;
border-color : transparent;
border-radius : 3px;
border-radius : 3px;
border : .3px solid hsla(0, 0%, 40%, .2);
border : .3px solid hsla(0, 0%, 40%, .2);
}
}
.container {
padding : 1em;
}
.type {
font-style : italic;
text-overflow : ellipsis;
width : 18em;
overflow : hidden;
white-space : nowrap;
}
.name {
font-weight : bold;
text-overflow : ellipsis;
width : 18em;
overflow : hidden;
white-space : nowrap;
}
`
`
/*
/*
...
@@ -39,8 +56,8 @@ class ContextView {
...
@@ -39,8 +56,8 @@ class ContextView {
render
()
{
render
()
{
var
view
=
yo
`<div class=
${
css
.
contextview
}
>
var
view
=
yo
`<div class=
${
css
.
contextview
}
>
<div>
<div
class=
${
css
.
container
}
>
<span>
${
this
.
_renderTarget
()}
</span>
${
this
.
_renderTarget
()}
</div>
</div>
</div>`
</div>`
if
(
!
this
.
_view
)
{
if
(
!
this
.
_view
)
{
...
@@ -73,7 +90,7 @@ class ContextView {
...
@@ -73,7 +90,7 @@ class ContextView {
this
.
_current
=
null
this
.
_current
=
null
if
(
this
.
_nodes
&&
this
.
_nodes
.
length
)
{
if
(
this
.
_nodes
&&
this
.
_nodes
.
length
)
{
var
last
=
this
.
_nodes
[
this
.
_nodes
.
length
-
1
]
var
last
=
this
.
_nodes
[
this
.
_nodes
.
length
-
1
]
if
(
last
.
name
===
'ContractDefinition'
||
last
.
name
===
'FunctionDefinition'
||
last
.
name
===
'ModifierDefinition'
||
last
.
name
===
'VariableDeclaration'
)
{
if
(
isDefinition
(
last
)
)
{
this
.
_current
=
last
this
.
_current
=
last
}
else
{
}
else
{
var
target
=
this
.
_api
.
contextualListener
.
declarationOf
(
last
)
var
target
=
this
.
_api
.
contextualListener
.
declarationOf
(
last
)
...
@@ -82,17 +99,28 @@ class ContextView {
...
@@ -82,17 +99,28 @@ class ContextView {
}
}
}
}
}
}
return
this
.
_render
Declarations
(
this
.
_current
)
return
this
.
_render
(
this
.
_current
)
}
}
_render
Declarations
(
node
)
{
_render
(
node
)
{
if
(
!
node
)
return
yo
`<div></div>`
if
(
!
node
)
return
yo
`<div></div>`
var
references
=
this
.
_api
.
contextualListener
.
referencesOf
(
node
)
var
references
=
this
.
_api
.
contextualListener
.
referencesOf
(
node
)
var
type
=
node
.
attributes
.
type
?
node
.
attributes
.
type
:
node
.
name
references
=
yo
`<div>
${
references
?
references
.
length
:
'0'
}
references</div>`
references
=
yo
`<div>
${
references
?
references
.
length
:
'0'
}
references</div>`
return
yo
`<div><div>
${
node
.
attributes
.
type
}
${
node
.
attributes
.
name
}
(
${
node
.
name
}
)</div>
return
yo
`<div>
<div class=
${
css
.
type
}
>
${
type
}
</div>
<div class=
${
css
.
name
}
>
${
node
.
attributes
.
name
}
</div>
<div>
${
references
}
</div>
<div>
${
references
}
</div>
</div>`
</div>`
}
}
}
}
function
isDefinition
(
node
)
{
return
node
.
name
===
'ContractDefinition'
||
node
.
name
===
'FunctionDefinition'
||
node
.
name
===
'ModifierDefinition'
||
node
.
name
===
'VariableDeclaration'
||
node
.
name
===
'StructDefinition'
}
module
.
exports
=
ContextView
module
.
exports
=
ContextView
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