@@ -75,12 +75,15 @@ class TestAppApp extends PolymerElement {
75
75
< paper-icon-button id ="statusicon " icon ="svg-sample-icons:online-status "> </ paper-icon-button >
76
76
77
77
< div main-title > Token Explorer</ div >
78
- < paper-icon-button icon ="svg-sample-icons:cart " on-tap ="_openBuy "> </ paper-icon-button >
78
+ < paper-button raised on-tap ="_openBuy ">
79
+ < iron-icon icon ="svg-sample-icons:cart "> </ iron-icon >
80
+ Buy
81
+ </ paper-button >
79
82
< iron-dropdown id ="buy " horizontal-align ="right " vertical-align ="top ">
80
83
< div slot ="dropdown-content ">
81
84
< h2 > Buy</ h2 >
82
- < paper-input label ="Buy [[name]] "> </ paper-input >
83
- < paper-button label =" kaufen " raised > Kaufen </ paper-button >
85
+ < paper-input id =" amount " label ="Buy [[name]] " value =" 10 " tab-index =" 0 "> </ paper-input >
86
+ < paper-button on-tap =" _purchaseCoin " raised > Buy </ paper-button >
84
87
</ div >
85
88
</ iron-dropdown >
86
89
< paper-icon-button icon ="svg-sample-icons:settings " on-tap ="_openSettings "> </ paper-icon-button >
@@ -136,7 +139,6 @@ class TestAppApp extends PolymerElement {
136
139
}
137
140
ready ( ) {
138
141
super . ready ( ) ;
139
- this . _triggerTokenSupply ( this . tokens [ 0 ] ) ;
140
142
installOfflineWatcher ( ( offline ) => {
141
143
142
144
if ( offline ) {
@@ -145,23 +147,21 @@ class TestAppApp extends PolymerElement {
145
147
this . $ . statusicon . removeAttribute ( 'disabled' ) ;
146
148
}
147
149
} )
150
+ this . name = this . tokens [ this . selectedToken ] . name
148
151
}
152
+ _purchaseCoin ( ) {
149
153
154
+ this . $ . buy . close ( ) ;
155
+ let buyAmount = this . $ . amount . value ;
156
+ console . log ( buyAmount ) ;
157
+ }
150
158
_openSettings ( ) {
151
159
this . $ . settings . toggle ( ) ;
152
160
}
153
161
_openBuy ( ) {
154
162
this . $ . buy . toggle ( ) ;
155
163
}
156
164
157
- _triggerTokenSupply ( token ) {
158
- var api = etherscanApi . init ( '' ) ;
159
- var supply = api . stats . tokensupply ( null , token . address ) ;
160
- supply . then ( ( res ) => {
161
- this . name = token . name ;
162
- this . supply = res . result
163
- } )
164
- }
165
165
_symbolForIndex ( index ) {
166
166
return this . datasetsIcons [ index ]
167
167
}
@@ -179,7 +179,6 @@ class TestAppApp extends PolymerElement {
179
179
this . _triggerHistory ( token ) ;
180
180
}
181
181
_changeToken ( token ) {
182
- this . _triggerTokenSupply ( this . tokens [ token ] )
183
182
this . _triggerHistory ( this . tokens [ token ] ) ;
184
183
}
185
184
_triggerHistory ( token ) {
0 commit comments