1. Zimmervermittlung Grensing UG (haftungsbeschränkt
  2. Sherlock Holmes
  3. General Talk
  4. Tuesday, 07 November 2017
  5.  Subscribe via email
Hello!

I have to trigger a few JS functions after each hotspot is rendered, or each time the hotspots tab is updated and the whole collection has rendered completely after user interaction.

I have to rearrange the content of the custom fields to suit my client's design needs.

I'm really close but I still have issues, because I only manage to get my code executed on the first page load but never on tab update so my design tweaks are lost everytime a user drags the map or searches the database. Could you please assist me?

I understand I have to edit this object for events triggered everytime users interact with the app after the page initially loads. I got to have some code execute there, although the hotspots info panel hadn't finished rendering and my code looks for existing DOM elements so it was still unable to find it.

from hotspots_app.js, I commented where I'm entering code


/**
* Created by DanielDimitrov on 26.02.14.
*/
HotspotsManager.module("HotspotsApp", function(HotspotsApp, HotspotsManager, Backbone, Marionette, $, _){

var API = {
renderHotspotsInTab: function() {
HotspotsApp.Tabs.Controller.render();
},
showList: function(hotspots) {
HotspotsApp.List.Controller.showList(hotspots);
// code written here executes after the list was generated but has not yet finished rendering
},
markerSelected: function(model, isSelected) {
HotspotsApp.List.Controller.selected(model, isSelected);
},
setPage: function(page) {
HotspotsApp.List.Controller.setPage(page);
},
shotTileHotspot: function(hotspot) {
HotspotsApp.List.Controller.shotTileHotspot(hotspot);
}
};

HotspotsManager.on('start:page', function(page) {
API.setPage(page);
});

HotspotsManager.on("tabs:ready", function(){
API.renderHotspotsInTab();
});

this.listenTo(HotspotsManager, "hotspots:fetchedData", function(hotspots) {
// code written here executes right before the list is generated
return API.showList(hotspots);
});
HotspotsManager.on("marker:selected", function(model, isSelected) {
API.markerSelected(model, isSelected);
});

HotspotsManager.on("tile:hotspot:loaded", function(model) {
API.shotTileHotspot(model);
});
});
});
Responses (1)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

Errror on Google Captcha V3 in Matukio
Hi, I am experiencing spam-problems on contact-forms protected by google reCa...
0 Replies
Posted on Wednesday, 20 March 2024
  • New
  • Google map styles migrating......
    Google are updating their map styles. Is there anything we need to do to migrate...
    0 Replies
    Posted on Monday, 18 March 2024
    • #google maps
    • #map styles
    Latest Hotspots Makes Website Hang
    When using the Latest Hotspot module, the webpage slows down and does not load....
    3 Replies
    Posted on Monday, 15 January 2024
    Text ändern
    Hallo in der Übersicht der Veranstaltungen kann man ja auf "Mehr Informati...
    0 Replies
    Posted on Thursday, 14 March 2024
    When is CComment compatible with Joomla 5?
    When is CComment compatible with Joomla 5?...
    3 Replies
    Posted on Tuesday, 05 December 2023
    • #CComment
    • #Joomla 5