aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/send.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-08-29 02:44:56 +0800
committerDan <danjm.com@gmail.com>2017-08-29 22:56:32 +0800
commitaf6e30b8baaed258381fd050b98452de0844d9c6 (patch)
tree298c61ffda47358b3dd6075ceac62a6668c3304f /ui/app/send.js
parenta381ce43e8722dbc2233b1ed89e44d82c1d79b46 (diff)
downloadtangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar.gz
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar.bz2
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar.lz
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar.xz
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.tar.zst
tangerine-wallet-browser-af6e30b8baaed258381fd050b98452de0844d9c6.zip
Bind SendTransactionScreen methods to this in constructor.
Diffstat (limited to 'ui/app/send.js')
-rw-r--r--ui/app/send.js29
1 files changed, 20 insertions, 9 deletions
diff --git a/ui/app/send.js b/ui/app/send.js
index 73d5616a1..f54a76926 100644
--- a/ui/app/send.js
+++ b/ui/app/send.js
@@ -64,6 +64,17 @@ function SendTransactionScreen () {
},
tooltipIsOpen: false,
}
+
+ this.back = this.back.bind(this)
+ this.back = this.back.bind(this)
+ this.closeTooltip = this.closeTooltip.bind(this)
+ this.getTxFeeBn = this.getTxFeeBn.bind(this)
+ this.onSubmit = this.onSubmit.bind(this)
+ this.onSubmit = this.onSubmit.bind(this)
+ this.recipientDidChange = this.recipientDidChange.bind(this)
+ this.setCurrentCurrency = this.setCurrentCurrency.bind(this)
+ this.setCurrentCurrency = this.setCurrentCurrency.bind(this)
+ this.toggleTooltip = this.toggleTooltip.bind(this)
}
SendTransactionScreen.prototype.bnMultiplyByFraction = function (targetBN, numerator, denominator) {
@@ -206,12 +217,12 @@ SendTransactionScreen.prototype.render = function () {
h('span', {}, [
h('span', {
className: currentCurrency === 'ETH' ? 'selected-currency' : 'unselected-currency',
- onClick: this.setCurrentCurrency.bind(this, 'ETH')
+ onClick: () => this.setCurrentCurrency('ETH')
}, ['ETH']),
'<>',
h('span', {
className: currentCurrency === 'USD' ? 'selected-currency' : 'unselected-currency',
- onClick: this.setCurrentCurrency.bind(this, 'USD'),
+ onClick: () => this.setCurrentCurrency('USD'),
}, ['USD']),
]), //holding on icon from design
]),
@@ -255,7 +266,7 @@ SendTransactionScreen.prototype.render = function () {
h('div.large-input.send-screen-gas-input', {}, [
currentCurrency === 'USD'
? h(FiatValue, {
- value: this.getTxFeeBn.bind(this)(this.state.newTx.gas.toString(16), this.state.newTx.gasPrice.toString(16)).toString(16),
+ value: this.getTxFeeBn(this.state.newTx.gas.toString(16), this.state.newTx.gasPrice.toString(16)).toString(16),
conversionRate,
currentCurrency,
style: {
@@ -277,7 +288,7 @@ SendTransactionScreen.prototype.render = function () {
className: 'send-tooltip',
gasPrice: parseInt(this.state.newTx.gasPrice, 16),
gasLimit: parseInt(this.state.newTx.gas, 16),
- onClose: this.closeTooltip.bind(this),
+ onClose: this.closeTooltip,
onFeeChange: ({gasLimit, gasPrice}) => {
this.setState({
newTx: Object.assign(
@@ -341,7 +352,7 @@ SendTransactionScreen.prototype.render = function () {
h('section.flex-column.flex-center', [
h('button.btn-light', {
- onClick: this.onSubmit.bind(this),
+ onClick: this.onSubmit,
style: {
marginTop: '8px',
width: '8em',
@@ -350,7 +361,7 @@ SendTransactionScreen.prototype.render = function () {
}, 'Next'),
h('button.btn-light', {
- onClick: this.back.bind(this),
+ onClick: this.back,
style: {
background: '#F7F7F7', // $alabaster
border: 'none',
@@ -469,7 +480,7 @@ SendTransactionScreen.prototype.renderSendToken = function () {
h(EnsInput, {
name: 'address',
placeholder: 'Recipient Address',
- onChange: this.recipientDidChange.bind(this),
+ onChange: this.recipientDidChange,
network,
identities,
addressBook,
@@ -561,7 +572,7 @@ SendTransactionScreen.prototype.renderSendToken = function () {
h('section.flex-column.flex-center', [
h('button.btn-light', {
- onClick: this.onSubmit.bind(this),
+ onClick: this.onSubmit,
style: {
marginTop: '8px',
width: '8em',
@@ -570,7 +581,7 @@ SendTransactionScreen.prototype.renderSendToken = function () {
}, 'Next'),
h('button.btn-light', {
- onClick: this.back.bind(this),
+ onClick: this.back,
style: {
background: '#F7F7F7', // $alabaster
border: 'none',