@servicetitan/ajax-handlers
Advanced tools
Comparing version 23.5.0 to 23.5.1
@@ -27,3 +27,2 @@ const loadingElementId = 'global-loading'; | ||
this.setInitialized(); | ||
this.handleEndFadeOut = this.handleEndFadeOut.bind(this); | ||
} | ||
@@ -75,3 +74,3 @@ show() { | ||
fadeOut() { | ||
this.element.addEventListener('transitionend', this.handleEndFadeOut, { once: true }); | ||
setTimeout(() => this.handleEndFadeOut(), 500); | ||
Object.assign(this.element.style, { opacity: '0', transition: 'opacity 0.5s' }); | ||
@@ -92,3 +91,3 @@ } | ||
handleEndFadeOut() { | ||
if (this.element.style.opacity === '0') { | ||
if (this.getCount() === 0) { | ||
Object.assign(this.element.style, { display: null, opacity: null, transition: null }); | ||
@@ -95,0 +94,0 @@ } |
{ | ||
"name": "@servicetitan/ajax-handlers", | ||
"version": "23.5.0", | ||
"version": "23.5.1", | ||
"description": "", | ||
@@ -21,5 +21,5 @@ "repository": { | ||
"devDependencies": { | ||
"@servicetitan/react-ioc": "23.5.0", | ||
"@servicetitan/react-ioc": "23.5.1", | ||
"@testing-library/jest-dom": "^6.4.2", | ||
"@testing-library/react": "^15.0.5", | ||
"@testing-library/react": "^15.0.6", | ||
"@types/js-cookie": "~3.0.3", | ||
@@ -31,3 +31,3 @@ "axios": "~0.28.0", | ||
"peerDependencies": { | ||
"@servicetitan/react-ioc": "23.5.0", | ||
"@servicetitan/react-ioc": "23.5.1", | ||
"axios": "~0.28.0", | ||
@@ -42,3 +42,3 @@ "react": ">=17.0.2" | ||
}, | ||
"gitHead": "fa1290f233700757bd3504849eea54c7d8e04af5" | ||
"gitHead": "afaf6f83281aa08beea5d57952c712108894654b" | ||
} |
@@ -62,6 +62,3 @@ class LoadingPage { | ||
describe('when element is done hiding', () => { | ||
beforeEach(() => { | ||
Object.assign(loadingPage.element.style, { opacity: '0' }); | ||
loadingPage.element.dispatchEvent(new Event('transitionend')); | ||
}); | ||
beforeEach(() => jest.runAllTimers()); | ||
@@ -68,0 +65,0 @@ test("resets the element's style", () => { |
@@ -26,3 +26,2 @@ const loadingElementId = 'global-loading'; | ||
this.setInitialized(); | ||
this.handleEndFadeOut = this.handleEndFadeOut.bind(this); | ||
} | ||
@@ -85,3 +84,3 @@ | ||
private fadeOut() { | ||
this.element.addEventListener('transitionend', this.handleEndFadeOut, { once: true }); | ||
setTimeout(() => this.handleEndFadeOut(), 500); | ||
Object.assign(this.element.style, { opacity: '0', transition: 'opacity 0.5s' }); | ||
@@ -104,3 +103,3 @@ } | ||
private handleEndFadeOut() { | ||
if (this.element.style.opacity === '0') { | ||
if (this.getCount() === 0) { | ||
Object.assign(this.element.style, { display: null, opacity: null, transition: null }); | ||
@@ -107,0 +106,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
122801
2339