Add publish button to udapp (triggers publishContract event)

pull/1/head
Alex Beregszaszi 8 years ago
parent 19ed87c3dc
commit 157c5367ec
  1. 13
      assets/css/universal-dapp.css
  2. 5
      src/universal-dapp.js

@ -173,7 +173,7 @@
.udapp input,
.udapp button {
width: 33%;
width: 20%;
display: block;
float: left;
padding: 0.25em;
@ -186,6 +186,13 @@
border-radius: 3px;
}
.udapp .publishContract {
background-color: #EC96EC;
border-color: #EC96EC;
margin-right: 1em;
border-radius: 3px;
}
.udapp input {
border-left: 0 none;
}
@ -312,6 +319,10 @@
width: 1em;
}
.udapp .legend .publish:before {
background-color: #EC96EC;
}
.udapp .legend .attach:before {
background-color: #B1EAC5;
}

@ -146,6 +146,7 @@ UniversalDApp.prototype.render = function () {
}
var $legend = $('<div class="legend" />')
.append($('<div class="publish"/>').text('Publish'))
.append($('<div class="attach"/>').text('Attach'))
.append($('<div class="transact"/>').text('Transact'))
.append($('<div class="payable"/>').text('Transact (Payable)'))
@ -189,6 +190,10 @@ UniversalDApp.prototype.getCreateInterface = function ($container, contract) {
$close.click(function () { self.$el.remove() })
$createInterface.append($close)
}
var $publishButton = $('<button class="publishContract"/>').text('Publish').click(function () { self.event.trigger('publishContract', [contract]) })
$createInterface.append($publishButton)
var $atButton = $('<button class="atAddress"/>').text('At Address').click(function () { self.clickContractAt(self, $container.find('.createContract'), contract) })
$createInterface.append($atButton)

Loading…
Cancel
Save