|
32 | 32 |
|
33 | 33 | <figure class="action"> |
34 | 34 | <figure class="bubble" @click="toggleAddingKey" :class="{'active':addingNewKey}"> |
35 | | - <i class="fa fa-plus"></i> |
| 35 | + <span v-if="!addingNewKey">Add key</span> |
| 36 | + <span v-if="addingNewKey">Back</span> |
36 | 37 | </figure> |
37 | 38 | </figure> |
38 | 39 | </section> |
|
76 | 77 | <Button v-if="!key.external" v-tooltip="`Convert blockchains`" icon="fa fa-link" @click.native="convertKeypair(key)" /> |
77 | 78 | <Button v-if="!isAccountlessChain" v-tooltip="`Refresh accounts`" icon="fa fa-sync-alt" :loading="loadingAccounts[key.unique()]" @click.native="refreshAccounts(key)" /> |
78 | 79 | <Button v-if="detachedKey(key)" icon="fa fa-trash" v-tooltip="`Remove key`" @click.native="removeKey(key)" /> |
| 80 | + <Button v-if="tappedCtrl" icon="fa fa-user" v-tooltip="`Manually Link Account`" @click.native="manuallyLinkAccount(key)" /> |
79 | 81 | </section> |
80 | 82 |
|
81 | 83 | <section class="accounts"> |
|
166 | 168 | loadingAccounts:{}, |
167 | 169 |
|
168 | 170 | accounts:{}, |
| 171 | + tappedCtrl:false, |
169 | 172 | }}, |
| 173 | + beforeMount(){ |
| 174 | + window.addEventListener("keydown", this.tapCtrl); |
| 175 | + }, |
| 176 | + beforeDestroy(){ |
| 177 | + window.removeEventListener("keydown", this.tapCtrl); |
| 178 | + }, |
170 | 179 | created(){ |
171 | 180 | this.keys.map(keypair => this.loadAccounts(keypair)); |
172 | 181 |
|
|
202 | 211 | } |
203 | 212 | }, |
204 | 213 | methods:{ |
| 214 | + async manuallyLinkAccount(keypair){ |
| 215 | + PopupService.push(Popups.getInput('Manually Link Account', 'If you link an account that does not actually belong to this key, you will not be able to sign anything.', 'account name', 'What is the account name?', async name => { |
| 216 | + if(!name || !name.length) return; |
| 217 | + let [account_name, permission] = name.split('@'); |
| 218 | + if(!permission || !permission.length) permission = 'active'; |
| 219 | +
|
| 220 | + this.select(Account.fromJson({ |
| 221 | + keypairUnique: keypair.unique(), |
| 222 | + networkUnique: this.network.unique(), |
| 223 | + name:account_name, |
| 224 | + permission, |
| 225 | + publicKey: keypair.publicKeys.find(x => x.blockchain === this.network.blockchain).key |
| 226 | + })); |
| 227 | + })) |
| 228 | + }, |
| 229 | + tapCtrl(event){ |
| 230 | + if (event.keyCode === 17) { |
| 231 | + this.tappedCtrl = !this.tappedCtrl; |
| 232 | + } |
| 233 | + }, |
205 | 234 | detachedKey(keypair){ |
206 | 235 | return !keypair.base; |
207 | 236 | }, |
|
448 | 477 | right:20px; |
449 | 478 |
|
450 | 479 | .bubble { |
451 | | - width:40px; |
452 | | - height:40px; |
| 480 | + padding:6px 12px; |
453 | 481 | background:$blue; |
454 | 482 | color:white; |
455 | | - font-size: 18px; |
| 483 | + font-size: $font-size-tiny; |
456 | 484 | display:flex; |
457 | 485 | justify-content: center; |
458 | 486 | align-items: center; |
459 | | - border-radius:50%; |
| 487 | + border-radius:4px; |
460 | 488 | cursor: pointer; |
461 | 489 |
|
462 | | - transition: transform 0.2s ease; |
463 | | -
|
464 | | - &:hover { transform:scale(1.1); } |
465 | | - &:active { transform:scale(0.9); } |
| 490 | + backface-visibility: hidden; |
466 | 491 |
|
467 | | - &.active { |
468 | | - transform:rotateZ(45deg); |
| 492 | + transition: background 0.2s ease; |
469 | 493 |
|
470 | | - &:hover { transform:rotateZ(45deg) scale(1.1); } |
471 | | - &:active { transform:rotateZ(45deg) scale(0.9); } |
472 | | - } |
| 494 | + &:hover { background:$darkblue; } |
| 495 | + &:active { background:$blue; } |
473 | 496 | } |
474 | 497 | } |
475 | 498 | } |
|
0 commit comments