Sha256: ff0c5143a3b58906bf45744125b3bac18f972f2fba844652c49bce88f949b9f0
Contents?: true
Size: 501 Bytes
Versions: 24
Compression:
Stored size: 501 Bytes
Contents
export default class { connect() { var $clearBtn = $('.btn-reset'); var $input = $clearBtn.parent().prev('input'); var btnCheck = function(){ if ($input.val() !== '') { $clearBtn.css('display', 'inline-block'); } else { $clearBtn.css('display', 'none'); } }; btnCheck(); $input.on('keyup', function() { btnCheck(); }); $clearBtn.on('click', function(event) { event.preventDefault(); $input.val(''); }); } }
Version data entries
24 entries across 24 versions & 1 rubygems