Browse Source

Modal UI bug fix

master
kj1352 5 years ago
parent
commit
1f8ce27465
2 changed files with 16 additions and 14 deletions
  1. +6
    -10
      src/app/malls/malls.page.ts
  2. +10
    -4
      src/global.scss

+ 6
- 10
src/app/malls/malls.page.ts View File

@@ -26,13 +26,11 @@ export class MallsPage implements OnInit {


ngOnInit() { ngOnInit() {
this.getMallsByLocation(); this.getMallsByLocation();
this.getMallsByFoodType('pizza');
} }


toggleMallBookmark(index: number) { toggleMallBookmark(index: number) {
this.tempMalls[index].mall.is_bookmarked = !this.tempMalls[index].mall.is_bookmarked; this.tempMalls[index].mall.is_bookmarked = !this.tempMalls[index].mall.is_bookmarked;
this.allMalls[index].mall.is_bookmarked = !this.allMalls[index].mall.is_bookmarked;
localStorage.allMalls = JSON.stringify(this.allMalls);
console.log(this.tempMalls[index].mall);
this.mallService.updateMallData(this.tempMalls[index]); this.mallService.updateMallData(this.tempMalls[index]);
} }


@@ -86,10 +84,9 @@ export class MallsPage implements OnInit {
this.toastService.presentToast("Getting malls based on your location...", "dark"); this.toastService.presentToast("Getting malls based on your location...", "dark");
navigator.geolocation.getCurrentPosition((position) => { navigator.geolocation.getCurrentPosition((position) => {
this.mallService.mallsByLocation(position.coords.latitude, position.coords.longitude).then((response: any) => { this.mallService.mallsByLocation(position.coords.latitude, position.coords.longitude).then((response: any) => {
if (response.length > 0) {
localStorage.allMalls = JSON.stringify(response);
this.allMalls = JSON.parse(localStorage.allMalls);
this.tempMalls = JSON.parse(localStorage.allMalls);
if (response.length > 0) {
this.allMalls = response;
this.tempMalls = response;
} else { } else {
this.toastService.presentToast("No malls near you your location, Getting all the malls...", "warning"); this.toastService.presentToast("No malls near you your location, Getting all the malls...", "warning");
this.getAllMalls(); this.getAllMalls();
@@ -105,9 +102,8 @@ export class MallsPage implements OnInit {


getAllMalls() { getAllMalls() {
this.mallService.allMalls().then((response) => { this.mallService.allMalls().then((response) => {
localStorage.allMalls = JSON.stringify(response);
this.allMalls = JSON.parse(localStorage.allMalls);
this.tempMalls = JSON.parse(localStorage.allMalls);
this.allMalls = response;
this.tempMalls = response;
}, (error) => { }, (error) => {
console.log(error); console.log(error);
}); });


+ 10
- 4
src/global.scss View File

@@ -153,13 +153,18 @@ figure {
background-color: white; background-color: white;
position: fixed; position: fixed;
width: 100%; width: 100%;
z-index: 5;
bottom: 0; bottom: 0;
left: 0; left: 0;
box-shadow: 0 0 5px var(--brand-grey); box-shadow: 0 0 5px var(--brand-grey);
transition: transform 0.5s;
transform: translateY(50vh);
transition: transform 0.3s, opacity 0.3s;
transform: translateY(50vh);
opacity: 0;
pointer-events: none;
z-index: 5;
&.active { &.active {
opacity: 1;
pointer-events: all;
transform: translateY(0); transform: translateY(0);
} }
header { header {
@@ -170,7 +175,8 @@ figure {
padding: 15px; padding: 15px;
font-size: 14px; font-size: 14px;
align-items: center; align-items: center;
position: sticky;
position: sticky;
position: -webkit-sticky;
top: 0; top: 0;
z-index: 1; z-index: 1;




Loading…
Cancel
Save