added toggle to searchbar; made text selectable
This commit is contained in:
parent
cf4d45cf59
commit
7d2b27be7d
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "insight-ui",
|
"name": "insight-ui",
|
||||||
"app_id": "",
|
"app_id": "",
|
||||||
"type": "ionic-angular"
|
"type": "ionic-angular",
|
||||||
|
"integrations": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
"@types/jasmine": "2.5.41",
|
"@types/jasmine": "2.5.41",
|
||||||
"@types/node": "7.0.4",
|
"@types/node": "7.0.4",
|
||||||
"codecov": "2.2.0",
|
"codecov": "2.2.0",
|
||||||
"ionic": "3.7.0",
|
"ionic": "3.8.1",
|
||||||
"jasmine-core": "2.5.2",
|
"jasmine-core": "2.5.2",
|
||||||
"jasmine-spec-reporter": "3.2.0",
|
"jasmine-spec-reporter": "3.2.0",
|
||||||
"karma": "1.4.1",
|
"karma": "1.4.1",
|
||||||
|
|||||||
@ -25,6 +25,10 @@
|
|||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
user-select: text;
|
||||||
|
}
|
||||||
|
|
||||||
// Shared Sass variables, which can be used to adjust Ionic's
|
// Shared Sass variables, which can be used to adjust Ionic's
|
||||||
// default Sass variables, belong in "theme/variables.scss".
|
// default Sass variables, belong in "theme/variables.scss".
|
||||||
//
|
//
|
||||||
|
|||||||
@ -7,9 +7,9 @@
|
|||||||
<button ion-button (click)="changeCurrency()">
|
<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> {{ currency.currencySymbol }}
|
<ion-icon name="logo-bitcoin" *ngIf="currency.currencySymbol !== 'USD'"></ion-icon><ion-icon name="logo-usd" *ngIf="currency.currencySymbol === 'USD'"></ion-icon> {{ currency.currencySymbol }}
|
||||||
</button>
|
</button>
|
||||||
<button ion-button icon-only>
|
<button ion-button icon-only (click)="toggleSearch()">
|
||||||
<ion-icon name="search"></ion-icon>
|
<ion-icon name="search"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</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>
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import { ActionSheetController } from 'ionic-angular';
|
|||||||
})
|
})
|
||||||
export class HeadNavComponent {
|
export class HeadNavComponent {
|
||||||
|
|
||||||
|
public showSearch: boolean = false;
|
||||||
public loading: boolean;
|
public loading: boolean;
|
||||||
@Input() public title: string;
|
@Input() public title: string;
|
||||||
public q: string;
|
public q: string;
|
||||||
@ -27,6 +28,7 @@ export class HeadNavComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public search(): void {
|
public search(): void {
|
||||||
|
this.showSearch = false;
|
||||||
let apiPrefix: string = this.api.apiPrefix;
|
let apiPrefix: string = this.api.apiPrefix;
|
||||||
|
|
||||||
this.http.get(apiPrefix + 'block/' + this.q).subscribe(
|
this.http.get(apiPrefix + 'block/' + this.q).subscribe(
|
||||||
@ -136,4 +138,8 @@ export class HeadNavComponent {
|
|||||||
});
|
});
|
||||||
actionSheet.present();
|
actionSheet.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public toggleSearch() {
|
||||||
|
this.showSearch = !this.showSearch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
Mined by
|
Mined by
|
||||||
<span item-end>
|
<span item-end *ngIf="block.poolInfo">
|
||||||
<a href="{{ block.poolInfo.url }}">{{ block.poolInfo.poolName }}</a>
|
<a href="{{ block.poolInfo.url }}">{{ block.poolInfo.poolName }}</a>
|
||||||
</span>
|
</span>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import 'rxjs/add/operator/map';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApiProvider {
|
export class ApiProvider {
|
||||||
|
|
||||||
public apiPrefix: string = 'http://localhost:3001/insight-api/';
|
public apiPrefix: string = 'https://insight.bitpay.com/api/';
|
||||||
|
|
||||||
constructor(public http: Http) {
|
constructor(public http: Http) {
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user