Okay
  Public Ticket #2694638
JS Event for when app has loaded?
Closed

Comments

  • Jim started the conversation

    Hi,

    I'd like to do some custom JS on the Ameilia front-end after it loads.

    setTimeOut is often unreliable. Is there an event to watch/listen for when the app has loaded?

  • [deleted] replied

    Hi Jim,

    These are the JS hooks available in Amelia, that are triggered depending on the view:

    window.beforeAddToCalendarLoaded()
    window.beforeBookingLoaded()
    window.beforeSearchLoaded()
    window.beforeSearchFiltered()
    window.afterSearchFiltered()
    window.beforeConfirmedBooking()
    window.beforeCatalogLoaded()
    window.afterSelectCatalogCategory(object_category)
    window.beforeCatalogCategoryLoaded(object_category)
    window.beforeCatalogServiceLoaded(object_category, object_service)
    window.afterSearchActivateService(object_appointment, object_serviceActive)
    window.afterSearchGoToSecondStep(object_appointment, object_serviceActive)
    window.afterBookingSelectDateAndTime(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.afterBookingSelectService(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.beforeConfirmBookingLoaded(object_appointment, object_service, object_provider, object_location)
    window.afterConfirmBooking(object_appointment, object_service, object_provider, object_location)

     So , you can try using one of these to achieve what you need. 

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.



  • Jim replied

    Thank you, very helpful.

    Since beforeCatalogCategoryLoaded exists, may I also request afterCatalogCategoryLoaded?

  • [deleted] replied

    You are welcome, Jim. 

    You can suggest it as a feature request here, and I will add it to our feeture requests so it can be considered for implementation in the future. But for now , it isn't available, and I can't say for sure if and when it could be implemented, unfortunately. 

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.


  • Jim replied

    Thanks very much, I have requested it.

  • [deleted] replied

    You are welcome, Jim.

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.