Customer’s Canvas
Call us at 1-800-661-8190 or send an email at info@aurigma.com
Opens the given product surface in the designer. Returns the product with the given surface (page) opened.
editor.getProduct() .then(function (product) { // Get the current surface index. const indexOfCurrentSurface = product.surfaces.lastIndexOf(product.currentSurface); if (indexOfCurrentSurface < 0) throw "Surface not found!"; let indexOfNextSurface = indexOfCurrentSurface + 1; if (indexOfNextSurface > (product.surfaces.length - 1)) indexOfNextSurface = 0; // Switch to the next surface. return product.switchTo(product.surfaces[indexOfNextSurface]); }) .then(function(result) { console.log("Surface switched"); }) .catch(function (error) { console.error("Switching the surfaces failed with exception: ", error); });
A surface (page) to open.
The product with the given surface (page) opened.