Skip to content

Commit

Permalink
Add display none when editor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiamatulis committed Sep 21, 2021
1 parent 75a15a0 commit 87d531a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/component-product-model.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.product__xr-button[data-shopify-xr-hidden] {
display: none;
visibility: hidden;
}

@media screen and (max-width: 749px) {
Expand Down
3 changes: 3 additions & 0 deletions assets/product-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ window.ProductModel = {
};

window.addEventListener('DOMContentLoaded', () => {
if (Shopify.designMode) {
document.querySelectorAll("[data-shopify-xr-hidden]").forEach(element => element.classList.add('hidden'));
}
if (window.ProductModel) window.ProductModel.loadShopifyXR();
});

0 comments on commit 87d531a

Please sign in to comment.