r112734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112733‎ | r112734 | r112735 >
Date:22:19, 29 February 2012
Author:krinkle
Status:ok
Tags:
Comment:
[ApiSandbox] Remove redundant click-handler
* The default behavior for <button type="submit"> is to trigger submission of the closest <form> ancestor. No point in preventing that from happening only to trigger it again.
* No change in behavior, just removal of redundant code

* Follows-up r112721
Modified paths:
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -515,13 +515,6 @@
516516 $submit = $submit.clone( /*dataAndEvents=*/true, /*deep=*/true )
517517 .appendTo( '#api-sandbox-parameters' )
518518 .add( $submit )
519 - .click( function ( e ) {
520 - // Don't do default action (crawl up to <form> and trigger a submit).
521 - // That would submit it twice (bug 34790)
522 - e.preventDefault();
523 -
524 - $form.submit();
525 - } )
526519 .button({ disabled: true });
527520
528521 $examplesButton = $( '<button>' )

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112721[ApiSandbox] Prevent duplicate submission of the form when clicking "Make Req...krinkle20:52, 29 February 2012

Status & tagging log