Commit 1de0ea28b957068bff7d5a5eaac82956b7529560

Authored by Koen Punt
1 parent 4c6c2485

added bg for transparent images

added width and height below images in diff
app/assets/images/trans_bg.gif 0 → 100644

58 Bytes

app/assets/stylesheets/sections/commits.scss
... ... @@ -133,9 +133,12 @@
133 133 .image {
134 134 display: inline-block;
135 135 margin:50px;
136   - padding:1px;
137 136 max-width:400px;
138 137  
  138 + img{
  139 + background: url('trans_bg.gif');
  140 + }
  141 +
139 142 &.diff_removed {
140 143 img{
141 144 border: 1px solid #C00;
... ...
app/views/commit/show.html.haml
... ... @@ -7,4 +7,19 @@
7 7 :javascript
8 8 $(function(){
9 9 PerLineNotes.init();
  10 + var w, h;
  11 + $('.diff_file').each(function(){
  12 + $('.image.diff_removed img', this).on('load', $.proxy(function(event){
  13 + var w = event.currentTarget.naturalWidth
  14 + , h = event.currentTarget.naturalHeight;
  15 + $('.image.diff_removed .image-info', this).append(' | <b>W:</b> ' + w + 'px | <b>H:</b> ' + h + 'px');
  16 + }, this));
  17 + $('.image.diff_added img', this).on('load', $.proxy(function(event){
  18 + var w = event.currentTarget.naturalWidth
  19 + , h = event.currentTarget.naturalHeight;
  20 + $('.image.diff_added .image-info', this).append(' | <b>W:</b> ' + w + 'px | <b>H:</b> ' + h + 'px');
  21 + }, this));
  22 +
  23 + });
  24 +
10 25 });
... ...