Fix some issues with new file attachment thumbnails.
Review Request #6269 — Created Aug. 25, 2014 and submitted — Latest diff uploaded
When uploading file attachments, the generated thumbnails end up with
some glitches with the caption editor and links.Opening the caption editor would result in the editor being shifted
over. This happened because the buttons element defaulted to 'display:
span' and not 'display: block' (due to a recent Djblets change),
messing up calculations.The download links for new attachments were also wrong, pointing to
nothing. When the attachment is first created, we have an empty
RB.FileAttachment, and we never updated those links.Similarly, icon URLs were set to 'null', causing 404s, at first. Now,
they're just not set until there's a value.All values going into the template are now escaped, preventing breakages
if uploading a filename that has special characters.And finally, several this.model.on() calls have been replaced with
this.listenTo() calls.
Uploaded files and checked all the links. They were valid.
Edited the caption, and saw that it appeared correctly.
Saw that there weren't any requests to 'null' for the icon anymore.
Checked existing file attachments. All links were correct.
Unit tests pass.