Sha256: b6637fdb0115a29fe8e5449c97b1048a2f6129050d15f1da629ce3a11228dd22
Contents?: true
Size: 994 Bytes
Versions: 54
Compression:
Stored size: 994 Bytes
Contents
/** * File attachments helper-wrapper. * * @author Htmlstream * @version 1.0 * */ ;(function ($) { 'use strict'; $.HSCore.helpers.HSFileAttachments = { /** * File attachment. * * @return undefined */ init: function () { var collection = $('.u-file-attach--v1 input[type="file"]:enabled, .u-file-attach--v2 input[type="file"]:enabled'); if (!collection.length) return; collection.each(function () { var $this = $(this), $thisParent = $this.closest('.u-file-attach--v1, .u-file-attach--v2'), textInputLength = $thisParent.find('input[type="text"]:enabled'); $this.on('change', function () { var thisVal = $this.val(); if (!textInputLength.length) { $thisParent.find('.js-value').text(thisVal.replace(/.+[\\\/]/, '')); } else { $thisParent.find('input[type="text"]:enabled').val(thisVal); } }); }); } }; })(jQuery);
Version data entries
54 entries across 54 versions & 1 rubygems