Sha256: 3489762b390cb796f4238eadee18404776c672bef9f73dff38a6eb325617153f
Contents?: true
Size: 651 Bytes
Versions: 9
Compression:
Stored size: 651 Bytes
Contents
export default class { connect(){ var container, target; function init() { const target_val = container.attr('data-target') if (!target_val) return target = $("#" + target_val); container.on('click', open); target.find('[data-behavior="cancel-link"]').on('click', close); } function open(event) { event.preventDefault(); target.slideToggle('slow'); } function close(event) { event.preventDefault(); target.slideUp('fast'); } return $('[data-behavior="contact-link"]').each(function() { container = $(this); init(); }); } }
Version data entries
9 entries across 9 versions & 1 rubygems