added toggle to searchbar; made text selectable

This commit is contained in:
Darren Nelsen 2017-08-15 16:36:11 -04:00
parent cf4d45cf59
commit 7d2b27be7d
7 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,6 @@
{
"name": "insight-ui",
"app_id": "",
"type": "ionic-angular"
"type": "ionic-angular",
"integrations": {}
}

View File

@ -43,7 +43,7 @@
"@types/jasmine": "2.5.41",
"@types/node": "7.0.4",
"codecov": "2.2.0",
"ionic": "3.7.0",
"ionic": "3.8.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "3.2.0",
"karma": "1.4.1",

View File

@ -25,6 +25,10 @@
font-size: 1.4rem;
}
body {
user-select: text;
}
// Shared Sass variables, which can be used to adjust Ionic's
// default Sass variables, belong in "theme/variables.scss".
//

View File

@ -7,9 +7,9 @@
<button ion-button (click)="changeCurrency()">
<ion-icon name="logo-bitcoin" *ngIf="currency.currencySymbol !== 'USD'"></ion-icon><ion-icon name="logo-usd" *ngIf="currency.currencySymbol === 'USD'"></ion-icon>&nbsp;{{ currency.currencySymbol }}
</button>
<button ion-button icon-only>
<button ion-button icon-only (click)="toggleSearch()">
<ion-icon name="search"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
<ion-searchbar (ionInput)="search($event)" placeholder="{{ 'Search for block, transaction or address' }}" [(ngModel)]="q" [debounce]="1000"></ion-searchbar>
<ion-searchbar [hidden]="!showSearch" (ionInput)="search($event)" placeholder="{{ 'Search for block, transaction or address' }}" [(ngModel)]="q" [debounce]="1500"></ion-searchbar>

View File

@ -18,6 +18,7 @@ import { ActionSheetController } from 'ionic-angular';
})
export class HeadNavComponent {
public showSearch: boolean = false;
public loading: boolean;
@Input() public title: string;
public q: string;
@ -27,6 +28,7 @@ export class HeadNavComponent {
}
public search(): void {
this.showSearch = false;
let apiPrefix: string = this.api.apiPrefix;
this.http.get(apiPrefix + 'block/' + this.q).subscribe(
@ -136,4 +138,8 @@ export class HeadNavComponent {
});
actionSheet.present();
}
public toggleSearch() {
this.showSearch = !this.showSearch;
}
}

View File

@ -35,7 +35,7 @@
</ion-item>
<ion-item>
Mined by
<span item-end>
<span item-end *ngIf="block.poolInfo">
<a href="{{ block.poolInfo.url }}">{{ block.poolInfo.poolName }}</a>
</span>
</ion-item>

View File

@ -11,7 +11,7 @@ import 'rxjs/add/operator/map';
@Injectable()
export class ApiProvider {
public apiPrefix: string = 'http://localhost:3001/insight-api/';
public apiPrefix: string = 'https://insight.bitpay.com/api/';
constructor(public http: Http) {
}