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
d80462e2
Commit
d80462e2
authored
May 30, 2017
by
yann300
Committed by
GitHub
May 30, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #562 from ethereum/contractTabTitles
Fixing styling (caret on instance, abstract contracts title)
parents
a6f33916
d77bb334
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
universal-dapp.js
src/universal-dapp.js
+22
-17
No files found.
src/universal-dapp.js
View file @
d80462e2
...
@@ -32,15 +32,18 @@ var css = csjs`
...
@@ -32,15 +32,18 @@ var css = csjs`
.title extends
${
styles
.
titleBox
}
{
.title extends
${
styles
.
titleBox
}
{
cursor: pointer;
cursor: pointer;
background-color:
${
styles
.
colors
.
violet
}
;
background-color:
${
styles
.
colors
.
violet
}
;
}
justify-content: flex-start;
.title:hover {
min-width: 400px;
opacity: .8;
}
}
.contract .title:before {
.contract .title:before {
margin-right: 30%;
margin-left: 5%;
content: "\\25BE";
content: "\\25BE";
}
}
.contract.hidesub .title:before {
.contract.hidesub .title:before {
content: "\\25B8"
margin-right: 30%;
margin-left: 5%;
content: "\\25B8";
}
}
.contract.hidesub {
.contract.hidesub {
padding-bottom: 0;
padding-bottom: 0;
...
@@ -49,12 +52,16 @@ var css = csjs`
...
@@ -49,12 +52,16 @@ var css = csjs`
.contract.hidesub > *:not(.title) {
.contract.hidesub > *:not(.title) {
display: none;
display: none;
}
}
.size {
margin-left: 20%;
}
`
`
var
cssInstance
=
csjs
`
var
cssInstance
=
csjs
`
.title {
.title {
display: flex;
display: flex;
justify-content: space-around;
justify-content: space-around;
min-width: 400px;
align-items: center;
align-items: center;
margin-bottom: 1em;
margin-bottom: 1em;
padding: .3em;
padding: .3em;
...
@@ -68,16 +75,15 @@ var cssInstance = csjs`
...
@@ -68,16 +75,15 @@ var cssInstance = csjs`
margin-right: 1em;
margin-right: 1em;
word-break: break-all;
word-break: break-all;
}
}
.titleText:hover {
opacity: .8;
}
.instance .title:before {
.instance .title:before {
content: "\\25BE";
content: "\\25BE";
margin-right: .5em;
margin-right: .5em;
margin-left: .5em;
}
}
.instance.hidesub .title:before {
.instance.hidesub .title:before {
content: "\\25B8"
content: "\\25B8"
;
margin-right: .5em;
margin-right: .5em;
margin-left: .5em;
}
}
.instance.hidesub {
.instance.hidesub {
padding-bottom: 0;
padding-bottom: 0;
...
@@ -86,12 +92,10 @@ var cssInstance = csjs`
...
@@ -86,12 +92,10 @@ var cssInstance = csjs`
.instance.hidesub > *:not(.title) {
.instance.hidesub > *:not(.title) {
display: none;
display: none;
}
}
.copy extends
${
styles
.
button
}
{
.copy extends
${
styles
.
button
}
{
border: 1px dotted
${
styles
.
colors
.
grey
}
;
border: 1px dotted
${
styles
.
colors
.
grey
}
;
border-radius: 5px;
padding: 0 .3em;
text-align: center;
font-weight: bold;
padding: .3em .3em;
min-width: 30%;
}
}
.copy:hover{
.copy:hover{
opacity: .7;
opacity: .7;
...
@@ -254,7 +258,7 @@ UniversalDApp.prototype.render = function () {
...
@@ -254,7 +258,7 @@ UniversalDApp.prototype.render = function () {
var
$title
=
$
(
`<span class="
${
css
.
title
}
"/>`
).
text
(
self
.
contracts
[
c
].
name
)
var
$title
=
$
(
`<span class="
${
css
.
title
}
"/>`
).
text
(
self
.
contracts
[
c
].
name
)
$title
.
click
(
function
(
ev
)
{
$
(
this
).
closest
(
`.
${
css
.
contract
}
`
).
toggleClass
(
`
${
css
.
hidesub
}
`
)
})
$title
.
click
(
function
(
ev
)
{
$
(
this
).
closest
(
`.
${
css
.
contract
}
`
).
toggleClass
(
`
${
css
.
hidesub
}
`
)
})
if
(
self
.
contracts
[
c
].
bytecode
)
{
if
(
self
.
contracts
[
c
].
bytecode
)
{
$title
.
append
(
$
(
'<div class="size"/>'
).
text
((
self
.
contracts
[
c
].
bytecode
.
length
/
2
)
+
' bytes'
))
$title
.
append
(
$
(
`<div class="
${
css
.
size
}
"></div>`
).
text
((
self
.
contracts
[
c
].
bytecode
.
length
/
2
)
+
' bytes'
))
}
}
$contractEl
.
append
(
$title
).
append
(
self
.
getCreateInterface
(
$contractEl
,
self
.
contracts
[
c
]))
$contractEl
.
append
(
$title
).
append
(
self
.
getCreateInterface
(
$contractEl
,
self
.
contracts
[
c
]))
}
}
...
@@ -352,8 +356,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -352,8 +356,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
var
len
=
address
.
length
var
len
=
address
.
length
var
shortAddress
=
address
.
slice
(
0
,
5
)
+
'...'
+
address
.
slice
(
len
-
5
,
len
)
var
shortAddress
=
address
.
slice
(
0
,
5
)
+
'...'
+
address
.
slice
(
len
-
5
,
len
)
var
title
=
yo
`
var
title
=
yo
`
<div class="
${
cssInstance
.
title
}
">
<div class="
${
cssInstance
.
title
}
"
onclick=
${
toggleClass
}
>
<div class="
${
cssInstance
.
titleText
}
"
onclick=
${
toggleClass
}
>
${
contract
.
name
}
at
${
shortAddress
}
(
${
context
}
) </div>
<div class="
${
cssInstance
.
titleText
}
">
${
contract
.
name
}
at
${
shortAddress
}
(
${
context
}
) </div>
<div class="
${
cssInstance
.
copy
}
" onclick=
${
copyToClipboard
}
> <i class="fa fa-clipboard" aria-hidden="true"></i> Copy address </div>
<div class="
${
cssInstance
.
copy
}
" onclick=
${
copyToClipboard
}
> <i class="fa fa-clipboard" aria-hidden="true"></i> Copy address </div>
</div>
</div>
`
`
...
@@ -361,7 +365,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
...
@@ -361,7 +365,8 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
$instance
.
toggleClass
(
`
${
cssInstance
.
hidesub
}
`
)
$instance
.
toggleClass
(
`
${
cssInstance
.
hidesub
}
`
)
}
}
function
copyToClipboard
()
{
function
copyToClipboard
(
event
)
{
event
.
stopPropagation
();
copy
(
address
)
copy
(
address
)
}
}
...
...
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