| @@ -40,17 +40,22 @@ | ||
| 40 | 40 | |
| 41 | 41 | function proceed() { |
| 42 | 42 | btn.dataset.eiConfirmed = '1'; |
| 43 | 43 | var form = btn.closest ? btn.closest('form') : null; |
| 44 | - if (form) { | |
| 44 | + var isSubmit = btn.tagName === 'BUTTON' ? (btn.type || 'submit') === 'submit' : (btn.tagName === 'INPUT' && btn.type === 'submit'); | |
| 45 | + if (btn.tagName === 'A' && btn.href) { | |
| 46 | + // A link inside a form (a row action in a bulk-action table) | |
| 47 | + // still just follows its href. | |
| 48 | + window.location.href = btn.href; | |
| 49 | + } else if (form && isSubmit) { | |
| 45 | 50 | if (typeof form.requestSubmit === 'function') { |
| 46 | 51 | form.requestSubmit(btn); |
| 47 | 52 | } else { |
| 48 | 53 | form.submit(); |
| 49 | 54 | } |
| 50 | - } else if (btn.href) { | |
| 51 | - window.location.href = btn.href; | |
| 52 | 55 | } else { |
| 56 | + // type="button" and similar: re-fire the click; the marker | |
| 57 | + // above lets the element's own handler run this time. | |
| 53 | 58 | btn.click(); |
| 54 | 59 | } |
| 55 | 60 | } |
| 56 | 61 | |