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

Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • New
    • #kml
    • #download
    Set number of hotspots / user groups
    Hi, I'm working with Hotspots for my new website and I love it! After trying ...
    0 Replies
    Posted on Monday, 31 March 2025
  • New
  • J5 compatibility for Hotspots
    Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
    1 Replies
    Posted on Monday, 24 February 2025
    • #Hotspots
    • #hotspots Joomla 5
    Text size in the comment input form
    Hello. How can I increase the font size in the comment input field? For examp...
    0 Replies
    Posted on Wednesday, 26 February 2025
    • #CComment 6
    Problem with enlarged image
    Hello. When you click on the image in the comments, it does not appear in the ce...
    1 Replies
    Posted on Wednesday, 26 February 2025