diff --git a/dreditor.user.js b/dreditor.user.js index 30d9926..4b3daf7 100644 --- a/dreditor.user.js +++ b/dreditor.user.js @@ -1572,7 +1572,7 @@ Drupal.behaviors.dreditorIssueSummaryTemplate = function() { }) .text('Insert template') .appendTo($label) - .click(function() { + .click(function(e) { // Load the issue summary instructions. $.get('//drupal.org/node/1326662', function(data) { // Retrieve the template. @@ -1615,8 +1615,8 @@ Drupal.behaviors.dreditorIssueSummaryTemplate = function() { // Prepend text to current body. $body.val($template.html().replace(/<\/em>/g, "\n\n").replace(/<\/h3>/g, "\n\n") + $body.val()); }); - // Take no action other than executing the .click() behavior. - return false; + // Prevent default "click" event. + e.preventDefault(); }); // Add a link to view the issue summary instructions. @@ -1663,11 +1663,13 @@ Drupal.behaviors.dreditorIssueSummaryTemplate = function() { $doc.find('#edit-sid').val('8'); $doc.find('#edit-title').val('Updated bare issue summary template').focus(); $doc.find('#edit-body').val('Log message: ' + $form.find('#edit-log').val()); + // Manually trigger the "submit" event. issueOpened = true; $form.trigger('submit'); }, 10); }); } + // Prevent default "submit" event. e.preventDefault(); } });