![]() ![]() GetSiteInfo ( callback ) JavaScript | Copy CodeĬallback function to receive the site info Right (x) coordinate value of the bounding rectangle Size of the component and its x,y coordinates, relative to the top-left of the viewportīottom (y) coordinate value of the bounding rectangle ![]() Top (y) coordinate value of the bounding rectangle Left (x) coordinate value of the bounding rectangle Value passed to callback: An object that contains two objects – offsets and rect: NameĬoordinates of the top-left point of the bounding rectangle, relative to the top-left of the viewport GetBoundingRectAndOffsets ( callback ) JavaScript | Copy CodeĪ callback function that returns the size and coordinates of the bounding rectangle and its offsets (in pixels) Issued when the user changed the position of a fixed-position widget. Issued when the user changed the site’s color palette. Availability: Since 1.76.0įor example:"attributes": Issued when the user presses one of these keys on the keyboard:left/right arrows, esc, enter, space bar. Issued when a component in your app called Wix.revalidateSession in the live site.Availability: Since 1.96.0 Issued when a user toggles between preview and edit mode in the editor. Issued when the user switches between the desktop editor and mobile editor. Note: This event is only sent to the component that was deleted, so use the method to alert other site components in your app about this event. Issued when the user deletes a site component. The events that you can currently listen to are: Event Unique event identifier, listed in the table belowĪ callback function that is called by the SDK once an event occurs The “return” value is passed as an argument in the callback function.ĪddEventListener ( eventName, callback ) JavaScript | Copy Code If you see a method in our SDK has a callback function, this means that the method is asynchronous. For example, when () is used in the App Settings endpoint, the function returns the component ID that called it – but for other endpoints, it returns null. Note: Although Wix.Utils is valid for all endpoints (except worker), if the called function doesn’t have a meaningful value to return, it returns null. It provides utility functions that can be called by all endpoints (except worker). For that reason we created a namespace Wix.Settings that holds all the functions that are valid in the App Settings endpoint.Īnother special namespace is the Wix.Utils. The App Settings endpoint is different since it is the only endpoint that resides in the Editor while the others reside in the user’s website or the My sites dashboard. ![]() The most obvious distinction is the App Settings endpoint. However, some of its functions make sense only in certain endpoints. The Wix global object can be used in all components’ endpoints – Widget, Page, Fixed Position, Dashboard, Worker, and App Settings – as well as its controls – Modal and Popup. Make sure to include a fallback behavior for your app in case the user is in the old Editor (like an alternate function) – otherwise, an error will occur.If the user is in the new Editor, you receive true via callback and you then need to call the relevant function. Call the function and specify the feature you want to use.To use these methods, you’ll need to detect the user’s Editor version and add a fallback option for the old Editor. We are gradually moving users over to the new Editor, so some users are still using the old Editor.Īll methods that are available since SDK version 1.45.0 are not supported in the old Editor. In 2015, we launched a new and improved version of the Wix Editor. When using more recent methods in the Editor, provide a fallback option for users in the old Editor. Starting from SDK 1.45.0, methods are not supported in the old Editor. When calling a method from the Editor, check the Editor version. ![]() Update your app to the latest version so that you can use all parameters in the method. For example: if a method is available since SDK 1.45.0 and updated in SDK 1.95, our documentation lists SDK 1.95 as the version. If a method is updated, we update its SDK version accordingly. We document the latest SDK version for each method.Update your app to use the latest version by replacing the version number in the script tag. We release new versions of our JavaScript SDK regularly. Once included, your window object will contain a new global Object named Wix. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |