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

Question regarding custom fields
How do I access custom fields after I have created them?...
0 Replies
Posted on Wednesday, 24 April 2024
  • New
    • #custom fields
    Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    0 Replies
    Posted on Wednesday, 24 April 2024
  • New
  • Language parameter in the link to the comment
    Hello. 1) I have a multilingual website (3 languages). If someone added a comme...
    1 Replies
    Posted on Saturday, 06 April 2024
    categories icon in header
    Hi! I saw this in the promo, but I can't find how to set it up. https://compo...
    0 Replies
    Posted on Monday, 22 April 2024
  • New
    • #style
    • #Categories
    Questions on new installation...
    Working on getting this set up... https://eastend2024.joepolecheck.com/rumma...
    3 Replies
    Posted on Wednesday, 17 April 2024
  • Resolved