Sha256: 27e7bb5c74d4f21cd1182d750a4257024deee90e07c073d6efab0f8cf76c8bec
Contents?: true
Size: 688 Bytes
Versions: 21
Compression:
Stored size: 688 Bytes
Contents
export default class { connect(){ var container, target; function init() { const target_val = container.attr('data-target') || container.attr('data-bs-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
21 entries across 21 versions & 1 rubygems