fixed stretched spurdo in notifications, misc fixes, detect gif by extension for now

This commit is contained in:
Henry Jameson 2018-02-03 20:32:13 +03:00
parent 3257991f41
commit 55bc1a3414
4 changed files with 13 additions and 14 deletions

View file

@ -126,7 +126,13 @@
display: flex;
flex: 1;
.still-image {
width: 100%;
height: 100%;
}
img {
object-fit: contain;
width: 100%;
height: 100%; /* If this isn't here, chrome will stretch the images */
max-height: 500px;

View file

@ -104,6 +104,10 @@
max-height: 12em;
overflow-y: hidden;
//text-overflow: ellipsis;
img {
object-fit: contain;
}
}
.notification-gradient {

View file

@ -12,14 +12,8 @@ const StillImage = {
}
},
computed: {
animated: {
get () {
// If mimetype is gif then it is certainly animated, if it's undefined - we don't know YET
return this.mimetype === 'image/gif' ? true : this.mimetype == null ? 'maybe' : false
},
set (val) {
this.mimetype = val
}
animated () {
return this.mimetype === 'image/gif' || this.src.endsWith('.gif')
}
},
methods: {
@ -27,12 +21,6 @@ const StillImage = {
const canvas = this.$refs.canvas
if (!canvas) return
canvas.getContext('2d').drawImage(this.$refs.src, 1, 1, canvas.width, canvas.height)
if (this.animated === 'maybe') {
fetch(this.src).then((data) => {
console.log(data)
this.animated = data.type
})
}
}
}
}

View file

@ -11,6 +11,7 @@
@import '../../_variables.scss';
.still-image {
position: relative;
line-height: 0;
&:hover canvas {
display: none;