code: function(event) {
        var e = event || window.event;
        var target = e.target || e.srcElement,
            targetedConfirm    = (target.className === 'confirm'),
            modalIsVisible     = hasClass(modal, 'visible'),
            doneFunctionExists = (params.doneFunction && modal.getAttribute('data-has-done-function') === 'true');
  
        switch (e.type) {
          case ("mouseover"):
            if (targetedConfirm) {
              target.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.04);
            }
            break;
          case ("mouseout"):
            if (targetedConfirm) {
              target.style.backgroundColor = params.confirmButtonColor;
            }
            break;
          case ("mousedown"):
            if (targetedConfirm) {
              target.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.14);
            }
            break;
          case ("mouseup"):
            if (targetedConfirm) {
              target.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.04);
            }
            break;
          case ("focus"):
            var $confirmButton = modal.querySelector('button.confirm'),
                $cancelButton  = modal.querySelector('button.cancel');
  
            if (targetedConfirm) {
              $cancelButton.style.boxShadow = 'none';
            } else {
              $confirmButton.style.boxShadow = 'none';
            }
            break;
          case ("click"):
            if (targetedConfirm && doneFunctionExists && modalIsVisible) { // Clicked "confirm"
  
              params.doneFunction(true);
  
              if (params.closeOnConfirm) {
                closeModal();
              }
            } else if (doneFunctionExists && modalIsVisible) { // Clicked "cancel"
  
              // Check if callback function expects a parameter (to track cancel actions)
              var functionAsStr          = String(params.doneFunction).replace(/\s/g, '');
              var functionHandlesCancel  = functionAsStr.substring(0, 9) === "function(" && functionAsStr.substring(9, 10) !== ")";
  
              if (functionHandlesCancel) {
                params.doneFunction(false);
              }
  
              if (params.closeOnCancel) {
                closeModal();
              }
            } else {
              closeModal();
            }
  
            break;
        }
      }
docs: Mouse interactions