closeReviewsDrawer()
closeReviewsDrawer():
Promise<Success|ErrorResult>
This method attempts to close the Reviews drawer.
Returns
Promise<Success | ErrorResult>
Promise that either resolves to a success result or rejects with an error
Example
Ensure the SDK is ready, the ReviewsDrawerWidget is injected, and the ReviewsSdk module is ready:
function onSdkReady() {
const eventName = window.gw.sdk.common.events.WIDGET_INJECTED;
window.gw.sdk.on(eventName, (event) => {
if (event.detail.widgetName === "ReviewsDrawerWidget") {
const moduleName = window.gw.sdk.common.constants.modules.REVIEWS;
window.gw.sdk.runIfModuleReady(moduleName, () => {
window.gw.sdk.reviews.methods.closeReviewsDrawer()
.then(console.log)
.catch(console.error);
});
}
});
}
if (window.gw && window.gw.sdk) {
onSdkReady();
} else {
document.addEventListener("gwSdkReady", onSdkReady);
}