equal
deleted
inserted
replaced
147 |
147 |
148 // Replace the original filename with the new (unique) one assigned during upload. |
148 // Replace the original filename with the new (unique) one assigned during upload. |
149 jQuery( '.filename.original', item ).replaceWith( jQuery( '.filename.new', item ) ); |
149 jQuery( '.filename.original', item ).replaceWith( jQuery( '.filename.new', item ) ); |
150 |
150 |
151 // Bind Ajax to the new Delete button. |
151 // Bind Ajax to the new Delete button. |
152 jQuery( 'a.delete', item ).click( function(){ |
152 jQuery( 'a.delete', item ).on( 'click', function(){ |
153 // Tell the server to delete it. TODO: Handle exceptions. |
153 // Tell the server to delete it. TODO: Handle exceptions. |
154 jQuery.ajax({ |
154 jQuery.ajax({ |
155 url: ajaxurl, |
155 url: ajaxurl, |
156 type: 'post', |
156 type: 'post', |
157 success: deleteSuccess, |
157 success: deleteSuccess, |
165 }); |
165 }); |
166 return false; |
166 return false; |
167 }); |
167 }); |
168 |
168 |
169 // Bind Ajax to the new Undo button. |
169 // Bind Ajax to the new Undo button. |
170 jQuery( 'a.undo', item ).click( function(){ |
170 jQuery( 'a.undo', item ).on( 'click', function(){ |
171 // Tell the server to untrash it. TODO: Handle exceptions. |
171 // Tell the server to untrash it. TODO: Handle exceptions. |
172 jQuery.ajax({ |
172 jQuery.ajax({ |
173 url: ajaxurl, |
173 url: ajaxurl, |
174 type: 'post', |
174 type: 'post', |
175 id: fileObj.id, |
175 id: fileObj.id, |