Merge pull request #2026 from koenpunt/extended-image-diff
Added bg for transparent images
This commit is contained in:
commit
9e8aadb0f0
BIN
app/assets/images/trans_bg.gif
Normal file
BIN
app/assets/images/trans_bg.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 58 B |
|
@ -133,9 +133,12 @@
|
||||||
.image {
|
.image {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin:50px;
|
margin:50px;
|
||||||
padding:1px;
|
|
||||||
max-width:400px;
|
max-width:400px;
|
||||||
|
|
||||||
|
img{
|
||||||
|
background: url('trans_bg.gif');
|
||||||
|
}
|
||||||
|
|
||||||
&.diff_removed {
|
&.diff_removed {
|
||||||
img{
|
img{
|
||||||
border: 1px solid #C00;
|
border: 1px solid #C00;
|
||||||
|
|
|
@ -7,4 +7,19 @@
|
||||||
:javascript
|
:javascript
|
||||||
$(function(){
|
$(function(){
|
||||||
PerLineNotes.init();
|
PerLineNotes.init();
|
||||||
|
var w, h;
|
||||||
|
$('.diff_file').each(function(){
|
||||||
|
$('.image.diff_removed img', this).on('load', $.proxy(function(event){
|
||||||
|
var w = event.currentTarget.naturalWidth
|
||||||
|
, h = event.currentTarget.naturalHeight;
|
||||||
|
$('.image.diff_removed .image-info', this).append(' | <b>W:</b> ' + w + 'px | <b>H:</b> ' + h + 'px');
|
||||||
|
}, this));
|
||||||
|
$('.image.diff_added img', this).on('load', $.proxy(function(event){
|
||||||
|
var w = event.currentTarget.naturalWidth
|
||||||
|
, h = event.currentTarget.naturalHeight;
|
||||||
|
$('.image.diff_added .image-info', this).append(' | <b>W:</b> ' + w + 'px | <b>H:</b> ' + h + 'px');
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue