Commit 76b62243 authored by prumde's avatar prumde

Updates for Search


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174341 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0130b114
......@@ -184,7 +184,8 @@
.sb-icon-search {
color: #fff;
z-index: 90;
background-image: url(../../assets/images/w_search_38_38.png);
/*background-image: url(../../assets/images/w_search_38_38.png);*/
background-image: url(../../assets/images/svg/w_search_38_38.svg);
background-position: 5px 4px;
background-repeat: no-repeat;
background-size: 24px 24px;
......
......@@ -13,12 +13,12 @@
</select>
</span>
</span>
<input type="submit" name="search-submit" class="search-submit"value="Search" />
<input type="submit" name="search-submit" class="search-submit" value="Search" (click)="search(myInput.value)"/>
</form>
<div *ngIf="headerState === 'fixed'" id="sb-search" class="sb-search">
<form>
<input class="sb-search-input" placeholder="Search ..." type="text"value="" name="search" id="search">
<input class="sb-search-submit" type="submit" value="">
<input #myInput class="sb-search-input" placeholder="Search ..." type="text"value="" name="search" id="search">
<input class="sb-search-submit" type="submit" value="" (click)="search(myInput.value)">
<span class="sb-icon-search"></span>
</form>
</div>
......@@ -2,6 +2,8 @@ import { Component, OnInit,ViewChild,ElementRef, Input, trigger, state, animate,
import { EventEmitter } from '@angular/core';
import { EcmLocation } from './ecm-location';
import { EcmLocationService } from './ecm-location.service';
import { SearchService } from './ecm-search-result/search.service';
import { Router } from '@angular/router';
@Component({
selector: 'ecm-search',
......@@ -29,20 +31,30 @@ import { EcmLocationService } from './ecm-location.service';
export class ECMSearchComponent implements OnInit {
@Input('compFadeState') compFadeState: string = 'false';
@Input('headerState') headerState: string = 'relative';
@ViewChild('myInput') form_address;
@ViewChild('myInput') searchBar;
public selectedCity: string;
public pincode;
public form_add;
search_key;
selectedPlace = 'Mumbai';
constructor(private _ngLocation: EcmLocationService) { }
constructor(private _ngLocation: EcmLocationService, private search_service: SearchService, private router: Router) {}
ngOnInit() {
this.selectedCity = localStorage.getItem('city');
this.search_key=this.search_service.getSearch();
}
ngAfterViewChecked() {
if(this.form_add)
this.form_address.nativeElement.value=this.form_add;
{
this.searchBar.nativeElement.value=this.form_add;
}
}
ngAfterViewInit() {
if(this.search_key && this.searchBar)
this.searchBar.nativeElement.value=this.search_key;
}
getAddress() {
......@@ -52,6 +64,11 @@ export class ECMSearchComponent implements OnInit {
});
}
search(value) {
this.search_service.setSearch(value.trim());
this.router.navigate(['/search',value.trim()]);
}
}
@Injectable()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment