| @@ -60,8 +60,21 @@ | ||
| 60 | 60 | var c = this; |
| 61 | 61 | jQuery(document).on('click', '#' + this.id, function () { |
| 62 | 62 | c.onClick(jQuery(this).attr('data-switch-target')); |
| 63 | 63 | }); |
| 64 | + | |
| 65 | + // Handle clicks on labels within the toggle wrapper | |
| 66 | + var $wrapper = this.dom.closest('.f12-checkbox-toggle'); | |
| 67 | + if ($wrapper.length) { | |
| 68 | + $wrapper.on('click', function (e) { | |
| 69 | + // Skip if clicking the toggle button itself | |
| 70 | + if (jQuery(e.target).closest('.btn-toggle').length) { | |
| 71 | + return; | |
| 72 | + } | |
| 73 | + e.preventDefault(); | |
| 74 | + c.onClick(c.dom.attr('name')); | |
| 75 | + }); | |
| 76 | + } | |
| 64 | 77 | } |
| 65 | 78 | |
| 66 | 79 | this.init(); |
| 67 | 80 | this.addEventHandler(); |