r110956 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110955‎ | r110956 | r110957 >
Date:19:54, 8 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
correctly pass along the comment arg
Modified paths:
  • /trunk/extensions/EducationProgram/resources/ep.pager.js (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/resources/ep.pager.js
@@ -72,23 +72,23 @@
7373 'for': 'epsummaryinput'
7474 } ).msg( 'ep-pager-summary-message-' + args.type ).append( ' ' );
7575
76 - summaryInput = $( '<input>' ).attr( {
 76+ $summaryInput = $( '<input>' ).attr( {
7777 'type': 'text',
7878 'size': 60,
7979 'maxlength': 250,
8080 'id': 'epsummaryinput'
8181 } );
8282
83 - $dialog.append( '<br /><br />', summaryLabel, summaryInput );
 83+ $dialog.append( '<br /><br />', summaryLabel, $summaryInput );
8484
85 - summaryInput.keypress( function( event ) {
 85+ $summaryInput.keypress( function( event ) {
8686 if ( event.which == '13' ) {
8787 event.preventDefault();
8888 onConfirm();
8989 }
9090 } );
9191
92 - summaryInput.focus();
 92+ $summaryInput.focus();
9393
9494 return deferred.promise();
9595 };
@@ -103,14 +103,13 @@
104104 args = {
105105 'type': $this.attr( 'data-type' ),
106106 'ids': [ $this.attr( 'data-id' ) ],
107 - 'names': [ $this.attr( 'data-name' ) ],
108 - 'comment': $summaryInput
 107+ 'names': [ $this.attr( 'data-name' ) ]
109108 };
110109
111110 showConfirmDialog(
112111 args,
113112 function() {
114 - ep.api.remove( args ).done( function() {
 113+ ep.api.remove( args, { 'comment': $summaryInput.val() } ).done( function() {
115114 $dialog.dialog( 'close' );
116115
117116 var $tr = $this.closest( 'tr' );
@@ -159,13 +158,13 @@
160159 'type': $( this ).attr( 'data-type' ),
161160 'ids': ids,
162161 'names': names,
163 - 'comment': $summaryInput
 162+ 'comment': $summaryInput.val()
164163 };
165164
166165 showConfirmDialog(
167166 args,
168167 function() {
169 - ep.api.remove( args ).done( function() {
 168+ ep.api.remove( args, { 'comment': $summaryInput.val() } ).done( function() {
170169 $dialog.dialog( 'close' );
171170
172171 if ( $table.find( 'tr' ).length - ids.length > 1 ) {

Status & tagging log