Repository: mozilla/send
File: frontend/src/upload.js (JavaScript)

Code before:
  } else {
    // eslint-disable-next-line prefer-const
    for (let index in files) {
      const id = files[index].fileId;
      //check if file still exists before adding to list
      checkExistence(id, files[index], true);
    }
  }

  // copy link to clipboard
  $copyBtn.on('click', () => {
    if (allowedCopy() && copyToClipboard($link.attr('value'))) {
      // record copied event from success screen
      sendEvent('sender', 'copied', {
        cd4: 'success-screen'
      });

      //disable button for 3s
      $copyBtn.attr('disabled', true);
      $link.attr('disabled', true);
      $copyBtn.html(
        '<img src="/resources/check-16.svg" class="icon-check"></img>'
      );
      window.setTimeout(() => {
        $copyBtn.attr('disabled', false);
        $link.attr('disabled', false);
        $copyBtn.attr('data-l10n-id', 'copyUrlFormButton');
      }, 3000);
    }
  });

  $uploadWindow.on('dragover', () => {
    $uploadWindow.addClass('ondrag');
  })
  .on('dragleave', () => {
    $uploadWindow.removeClass('ondrag');
  });

  //initiate progress bar
  $ulProgress.circleProgress({
    value: 0.0,
    startAngle: -Math.PI / 2,
    fill: '#3B9DFF',
    size: 158,
    animation: { duration: 300 }
  });

  //link back to homepage
  $('.send-new').attr('href', window.location);

  // on file upload by browse or drag & drop

Review comment (suggestion):
You could potentially move `$link.attr()` up a line and chain both `$copyBtn.attr()` calls.
I think you can also set multiple values in a single `.attr()` by passing an object: http://api.jquery.com/attr/#attr-attributes

```js
$link.attr('disabled', false);
$copyBtn.attr({
  disabled: false,
  'data-l10n-id': 'copyUrlFormButton'
});
```


Code after:
          //check if file still exists before adding to list
          checkExistence(id, files[index], true);
        }
      }

      // copy link to clipboard
      $copyBtn.on('click', () => {
        if (allowedCopy() && copyToClipboard($link.attr('value'))) {
          // record copied event from success screen
          sendEvent('sender', 'copied', {
            cd4: 'success-screen'
          });

          //disable button for 3s
          $copyBtn.attr('disabled', true);
          $link.attr('disabled', true);
          $copyBtn.html(
            '<img src="/resources/check-16.svg" class="icon-check"></img>'
          );
          setTimeout(() => {
            $copyBtn.attr({
              disabled: false,
              'data-l10n-id': 'copyUrlFormButton'
            });
            $link.attr('disabled', false);
          }, 3000);
        }
      });

      $uploadWindow.on('dragover', () => {
        $uploadWindow.addClass('ondrag');
      })
      .on('dragleave', () => {
        $uploadWindow.removeClass('ondrag');
      });

      //initiate progress bar
      $ulProgress.circleProgress({
        value: 0.0,
        startAngle: -Math.PI / 2,
        fill: '#3B9DFF',
        size: 158,
        animation: { duration: 300 }
      });

      //link back to homepage
      $('.send-new').attr('href', window.location);

      // on file upload by browse or drag & drop
      function onUpload(event) {
        event.preventDefault();