Claims: add alert when add or remove from the basket
This commit is contained in:
parent
f8b76246f5
commit
4608635879
|
@ -28,11 +28,11 @@ declare var UIkit: any;
|
||||||
height="1"></rect></svg>
|
height="1"></rect></svg>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<span *ngIf="isSelected(entity)" class="uk-icon-button uk-button-primary ">
|
<a *ngIf="isSelected(entity)" class="uk-icon-button uk-button-primary " (click)="remove(entity)">
|
||||||
<span class="uk-icon" >
|
<span class="uk-icon" >
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1" points="4,10 8,15 17,4"></polyline></svg>
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="check" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.1" points="4,10 8,15 17,4"></polyline></svg>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -78,6 +78,27 @@ export class ClaimResultsComponent {
|
||||||
if (this.selectedResults != null) {
|
if (this.selectedResults != null) {
|
||||||
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults));
|
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults));
|
||||||
}
|
}
|
||||||
|
UIkit.notification(item.type + ' added in your basket!', {
|
||||||
|
status: 'success',
|
||||||
|
timeout: 4000,
|
||||||
|
pos: 'bottom-right'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove(item: any) {
|
||||||
|
const index: number = this.selectedResults.indexOf(item);
|
||||||
|
if (index > -1) {
|
||||||
|
this.selectedResults.splice(index, 1);
|
||||||
|
if (this.selectedResults != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.selectedResults));
|
||||||
|
}
|
||||||
|
UIkit.notification(item.type + ' removed from your basket!', {
|
||||||
|
status: 'warning',
|
||||||
|
timeout: 4000,
|
||||||
|
pos: 'bottom-right'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
|
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
|
||||||
|
declare var UIkit: any;
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'claim-selected-results',
|
selector: 'claim-selected-results',
|
||||||
templateUrl: 'selectedResults.component.html'
|
templateUrl: 'selectedResults.component.html'
|
||||||
|
@ -24,6 +24,11 @@ export class ClaimSelectedResultsComponent {
|
||||||
if (this.results != null) {
|
if (this.results != null) {
|
||||||
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
|
localStorage.setItem(this.localStoragePrefix, JSON.stringify(this.results));
|
||||||
}
|
}
|
||||||
|
UIkit.notification(item.type + ' removed from your basket!', {
|
||||||
|
status: 'warning',
|
||||||
|
timeout: 4000,
|
||||||
|
pos: 'bottom-right'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue