You can use JS event on open lightbox:
var Ajax = require('elgg/Ajax');
var ajax = new Ajax();
$(document).on('cbox_open', function() {
$.ajax({
url: elgg.get_simplecache_url('my_plugin/my_plugin_js.js'),
dataType: 'script'
});
}
Your general problem is code in a module executes once. It sounds like your module should add an event listener for when colorbox opens. Just curious, what does that code do?
@Steve Clay: the code generates a paypal button. So it may have different values, e.g. cost on each popup open.
But the JS is not loaded after 1st popup, even if it has a simple command such as "console.log".
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.