How to retrieve senna.js app object in theme's script?How to retrieve senna.js app object in theme's script?https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1199031452024-03-29T01:21:19Z2024-03-29T01:21:19ZRE: How to retrieve senna.js app object in theme's script?Peter Panhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199153452020-09-07T21:02:34Z2020-09-07T21:02:34ZSo I found out there exists "Liferay.spa.app" and and "Liferay.on" which can be used to override some senna functionality. There appears to be very little documentation on the Liferay.spa javascript object. Transitions still happen too quickly, at least on localhost testing and I would like to specify a minimum delay to allow the transition to complete before swapping out. Any ideas how to do this?<br />thanks<blockquote> Liferay.spa.app.setLoadingCssClass("xyz-nav-hide");<br /> Liferay.on('beforeNavigate', function(event) {<br /> if(visible) {<br /> nav.removeClass("xyz-nav-show");<br /> visible=false;<br /> }<br /> });<br /></blockquote>Peter Pan2020-09-07T21:02:34ZHow to retrieve senna.js app object in theme's script?Peter Panhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1199031442020-09-07T05:30:24Z2020-09-07T05:30:24ZHi all,<br /><br />I am still getting to grips with how Senna.js works. Since its mostly transparent when developing a theme its difficult to find examples when its needs to be specifically invoked. I am not sure if I even need to do this for the issue I want to resolve. Let me set the scene:<br />I have customised the navigation menu with some css animations. On link click I have a custom function to change the class for the animation. The animation is terminated when this function returns. I would like the animation to finish and then display the results of the page fetch. <br />I am thinking as follows:<br />Do an "e.preventDefault()" call at the end of my function. Then in a "onanimationend" event listener fire the senna "app.navigate()" method. Three questions: <br /><ul style="list-style: disc outside;"><li>Is this the best way to go? (It would be great if the fetch can start while the animation is playing out.)</li><li>The page fetches are to different sites with own domains but on the same liferay instance - will this impact how senna works?</li><li>How do I get