Changeset 296
- Timestamp:
- 01/17/2014 04:20:24 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js
r288 r296 48 48 // Automatically preview images. 49 49 $('li.trac-field-attachment').each( function() { 50 var href, el, image, li = $(this); 51 el = $(this).find('.trac-rawlink'); 50 var href, el, image, appendTo, 51 li = $(this); 52 el = li.find('.trac-rawlink'); 52 53 href = el.attr('href'); 53 54 if ( ! href.match(/\.(jpg|jpeg|png|gif)$/i) ) { 54 55 return; 55 56 } 57 appendTo = li.parent().parent(); // div.change 56 58 image = new Image; 57 59 image.src = href; … … 64 66 class: 'trac-image-preview' 65 67 }) 66 .appendTo( li)68 .appendTo( appendTo ) 67 69 .wrap( '<a href="' + href.replace('/raw-attachment/', '/attachment/') + '" />' ); 68 70 };
Note: See TracChangeset
for help on using the changeset viewer.