Sha256: 8a45eb1977dd87c2351561b5f3ebb179f560ad1151ae0520704926fdf2eaa964
Contents?: true
Size: 944 Bytes
Versions: 4
Compression:
Stored size: 944 Bytes
Contents
/* global Fae */ 'use strict'; /** * Fae form checkbox * @namespace form.checkbox * @memberof form */ Fae.form.checkbox = { init: function() { this.loginCheckbox(); this.setCheckboxAsActive(); }, /** * Login page checkbox listeners to add active class on click */ loginCheckbox: function() { $('.login-body') .on('click', 'label.boolean', function(e){ $(this).toggleClass('js-active'); }) .on('click', '.input.boolean :checkbox', function(e){ e.stopPropagation(); }); }, /** * Run through the checkboxes and see if they are checked. apply js class for styling. */ setCheckboxAsActive: function() { $('.boolean label, .checkbox_collection--vertical label, .checkbox_collection--horizontal label').each(function(){ var $this = $(this); if ($this.find(':checkbox:checked').length) { $this.addClass('js-active'); } }); } };
Version data entries
4 entries across 4 versions & 1 rubygems