asprin
Active member
So I've a 
	
	
	
		
And the javascript is as follows:
	
	
	
		
Now when I click on a checkbox, this is what the console looks like:

So
				
			data-xf-click defined on a xf:toggle inside a loop.
		HTML:
	
	<xf:foreach loop="$data" value="$obj">
    <xf:toggle name="abc[]" data-xf-click="foo" value="{{$obj.sys_id}}" />
</xf:foreach>
	And the javascript is as follows:
		JavaScript:
	
	var AsprinFB = window.AsprinFB || {};
/** @param {jQuery} $ */
!(function($, window, document, _undefined) {
    'use strict';
     
    AsprinFB.ClickHandler = XF.Click.newHandler({
        eventType: 'click',
        eventNameSpace: 'AsprinFBClickHandler',  
        init: function() {    
            console.log('initialised');
        },
        click: function(event) {                              
              console.log('clicked');
        }
    });
    XF.Click.register('foo', 'AsprinFB.ClickHandler');
})(jQuery, window, document);
	Now when I click on a checkbox, this is what the console looks like:

So
initialised runs 2 times and click 4 times. Is there a way to prevent them from firing multiple times on the first click?