From 8a4cab211249a24b45c4869e1d6f169bd9cb54c6 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Fri, 3 Jun 2022 02:22:37 +0530 Subject: [PATCH] Bug fixes -- fixed votes not displayed correctly after voting and refreshing --- components.js | 12 ++++++------ index.html | 46 +++++++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/components.js b/components.js index e1164d6..7053ca9 100644 --- a/components.js +++ b/components.js @@ -1154,7 +1154,7 @@ customElements.define('sm-popup', class extends HTMLElement { this.popupContainer = this.shadowRoot.querySelector('.popup-container'); this.backdrop = this.shadowRoot.querySelector('.background'); - this.popup = this.shadowRoot.querySelector('.popup'); + this.dialogBox = this.shadowRoot.querySelector('.popup'); this.popupBodySlot = this.shadowRoot.querySelector('.popup-body slot'); this.popupHeader = this.shadowRoot.querySelector('.popup-top'); @@ -1199,7 +1199,7 @@ customElements.define('sm-popup', class extends HTMLElement { easing: 'ease' } const initialAnimation = (window.innerWidth > 640) ? 'scale(1.1)' : `translateY(${this.offset ? `${this.offset}px` : '100%'})` - this.animateTo(this.popup, [ + this.animateTo(this.dialogBox, [ { opacity: this.offset ? 1 : 0, transform: initialAnimation @@ -1264,7 +1264,7 @@ customElements.define('sm-popup', class extends HTMLElement { { opacity: 1 }, { opacity: 0 } ], animOptions) - this.animateTo(this.popup, [ + this.animateTo(this.dialogBox, [ { opacity: 1, transform: (window.innerWidth > 640) ? 'none' : `translateY(${this.offset ? `${this.offset}px` : '0'})` @@ -1276,7 +1276,7 @@ customElements.define('sm-popup', class extends HTMLElement { ], animOptions).finished .finally(() => { this.popupContainer.classList.add('hide'); - this.popup.style = '' + this.dialogBox.style = '' this.removeAttribute('open'); if (this.forms.length) { @@ -1316,7 +1316,7 @@ customElements.define('sm-popup', class extends HTMLElement { if (this.touchStartY < e.changedTouches[0].clientY) { this.offset = e.changedTouches[0].clientY - this.touchStartY; this.touchEndAnimation = window.requestAnimationFrame(() => { - this.popup.style.transform = `translateY(${this.offset}px)`; + this.dialogBox.style.transform = `translateY(${this.offset}px)`; }); } } @@ -1325,7 +1325,7 @@ customElements.define('sm-popup', class extends HTMLElement { this.touchEndTime = e.timeStamp; cancelAnimationFrame(this.touchEndAnimation); this.touchEndY = e.changedTouches[0].clientY; - this.threshold = this.popup.getBoundingClientRect().height * 0.3; + this.threshold = this.dialogBox.getBoundingClientRect().height * 0.3; if (this.touchEndTime - this.touchStartTime > 200) { if (this.touchEndY - this.touchStartY > this.threshold) { if (this.pinned) { diff --git a/index.html b/index.html index 3c29162..6416e50 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ RanchiMall Times - + @@ -130,10 +130,8 @@

RanchiMall Times

- - +