Sha256: 1c2cf572e4b5ec0fb465fb8a65f07861c7f61f8b67e2740571265a911b8415c4
Contents?: true
Size: 826 Bytes
Versions: 32
Compression:
Stored size: 826 Bytes
Contents
Spree.ready(function() { $('.store-credit-memo-row').each(function() { var row = this; var field = row.querySelector('[name="store_credit[memo]"]') var textDisplay = row.querySelector('.store-credit-memo-text') $(row).on('ajax:success', function(event, data) { row.classList.remove('editing'); field.defaultValue = field.value; textDisplay.textContent = field.value; show_flash('success', data.message); }).on('ajax:error', function(event, xhr, status, error) { show_flash('error', xhr.responseJSON.message); }); row.querySelector('.edit-memo').addEventListener('click', function() { row.classList.add('editing'); }); row.querySelector('.cancel-memo').addEventListener('click', function() { row.classList.remove('editing'); }); }); });
Version data entries
32 entries across 32 versions & 2 rubygems