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
798c6443
Commit
798c6443
authored
Sep 01, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show a disabled Create button for abstract contracts
parent
c8292108
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
universal-dapp.css
assets/css/universal-dapp.css
+6
-0
universal-dapp.js
src/universal-dapp.js
+11
-3
No files found.
assets/css/universal-dapp.css
View file @
798c6443
...
@@ -216,6 +216,12 @@
...
@@ -216,6 +216,12 @@
width
:
21px
;
width
:
21px
;
}
}
.udapp
.contractProperty
button
:disabled
{
cursor
:
not-allowed
;
background-color
:
white
;
border-color
:
lightgray
;
}
.udapp
.contractProperty
.call
{
.udapp
.contractProperty
.call
{
background-color
:
#FF8B8B
;
background-color
:
#FF8B8B
;
border-color
:
#FF8B8B
;
border-color
:
#FF8B8B
;
...
...
src/universal-dapp.js
View file @
798c6443
...
@@ -216,11 +216,19 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
...
@@ -216,11 +216,19 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
var
$atButton
=
$
(
'<button class="atAddress"/>'
).
text
(
'At Address'
).
click
(
function
()
{
self
.
clickContractAt
(
self
,
$container
.
find
(
'.createContract'
),
contract
);
});
var
$atButton
=
$
(
'<button class="atAddress"/>'
).
text
(
'At Address'
).
click
(
function
()
{
self
.
clickContractAt
(
self
,
$container
.
find
(
'.createContract'
),
contract
);
});
$createInterface
.
append
(
$atButton
);
$createInterface
.
append
(
$atButton
);
// Only display creation interface for non-abstract contracts.
// FIXME: maybe have a flag for this in the JSON?
if
(
contract
.
bytecode
.
length
!==
0
)
{
var
$newButton
=
self
.
getInstanceInterface
(
contract
);
var
$newButton
=
self
.
getInstanceInterface
(
contract
);
$createInterface
.
append
(
$newButton
);
$createInterface
.
append
(
$newButton
);
// Only display creation interface for non-abstract contracts.
// FIXME: maybe have a flag for this in the JSON?
// FIXME: maybe fix getInstanceInterface() below for this case
if
(
contract
.
bytecode
.
length
===
0
)
{
var
$createButton
=
$newButton
.
find
(
'.constructor .call'
);
// NOTE: we must show the button to have CSS properly lined up
$createButton
.
text
(
'Create'
);
$createButton
.
attr
(
'disabled'
,
'disabled'
);
$createButton
.
attr
(
'title'
,
'This contract does not implement all functions and thus cannot be created.'
);
}
}
return
$createInterface
;
return
$createInterface
;
...
...
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