Commits

Mike Cannon-Brookes committed 7aca00b

Added gallery triggering code thanks to Brad

  • Participants
  • Parent commits afdacf8

Comments (0)

Files changed (1)

src/main/resources/js/attachment-improvements.js

 		
 		jQuery.each(addedAttachments, function(id, attachment) { 
 			if (!removedAttachments[id]) {
-				attachment.cell.html('<a href="' + contextPath + '/secure/attachment/' + id + '/' + encodeURI(attachment.filename) + '">' + attachment.filename + '</a> [' + id + ']' + (attachment.isImage ? '<br/ ><img src="' + contextPath + '/secure/thumbnail/' + id + '/' + id + '">' : ''));
+				attachment.cell.html('<a href="' + contextPath + '/secure/attachment/' + id + '/' + encodeURI(attachment.filename) + '" onclick="jQuery(\'a.gallery[href*=/attachment/' + id + ']\').trigger(\'click\'); return false;">' + attachment.filename + '</a> [' + id + ']' + (attachment.isImage ? '<br/ ><a href="' + contextPath + '/secure/attachment/' + id + '/' + encodeURI(attachment.filename) + '" onclick="jQuery(\'a.gallery[href*=/attachment/' + id + ']\').trigger(\'click\'); return false;"><img src="' + contextPath + '/secure/thumbnail/' + id + '/' + id + '"></a>' : ''));
 			}
 			else {
 				attachment.cell.html('<a name="addAttachment' + id + '"></a><strike>' + attachment.filename + ' [' + id + ']</strike> (removed <a href="#removeAttachment' + id + '">later</a>)')