Skip to content

Commit

Permalink
Rearrange center handling css and fix centering of video and audio.
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-d committed Feb 11, 2016
1 parent 4f32f36 commit 059f199
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions client/css/up1.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@
max-width: 100%;
}

#previewimg img {
#previewimg img, .preview video, .preview audio {
display: block;
margin: 0 auto;
}

#previewimg img:not(.dragged) {
#previewimg img:not(.dragged), .preview audio, .preview video {
max-height: 100vh;
max-width: 100vw;
}
Expand Down Expand Up @@ -324,11 +324,14 @@
white-space: nowrap;
}

audio.preview,video.preview,.downloadexplain,#downloadprogress,#previewimg {
.centertext {
text-align: center;
}

.centerable {
-webkit-transform: translateY(-50%);
margin: 0 auto;
position: relative;
text-align: center;
top: 50%;
transform: translateY(-50%);
}
Expand Down
10 changes: 5 additions & 5 deletions client/js/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ upload.modules.addmodule({
this._.editpaste.hide()
this._.newupload.hide()
this._.content = {}
this._.content.main = this._.content.loading = $('<h1>').prop('id', 'downloadprogress').text('Downloading')
this._.content.main = this._.content.loading = $('<h1>').prop('id', 'downloadprogress').addClass('centertext centerable').text('Downloading')
this._.detailsarea.empty().append(this._.content.main)
this._.deletebtn.hide()
upload.updown.download(content, this.progress.bind(this), this.downloaded.bind(this))
Expand Down Expand Up @@ -192,7 +192,7 @@ upload.modules.addmodule({
}

if (association == 'image' || association == 'svg') {
var imgcontent = $('<div>').prop('id', 'previewimg').addClass('preview').appendTo(this._.detailsarea)
var imgcontent = $('<div>').prop('id', 'previewimg').addClass('preview centerable').appendTo(this._.detailsarea)

var previewimg = $('<img>').addClass('dragresize').appendTo(imgcontent).prop('src', url)
} else if (association == 'text') {
Expand Down Expand Up @@ -225,11 +225,11 @@ upload.modules.addmodule({

this._.editpaste.show()
} else if (association == 'video') {
$('<video>').addClass('preview').prop('controls', true).prop('autoplay', true).appendTo(this._.detailsarea).prop('src', url)
$('<div>').addClass('preview centerable').append($('<video>').prop('controls', true).prop('autoplay', true).prop('src', url)).appendTo(this._.detailsarea)
} else if (association == 'audio') {
$('<audio>').addClass('preview').prop('controls', true).prop('autoplay', true).appendTo(this._.detailsarea).prop('src', url)
$('<div>').addClass('preview centerable').append($('<audio>').prop('controls', true).prop('autoplay', true).prop('src', url)).appendTo(this._.detailsarea)
} else {
$('<div>').addClass('preview').addClass('downloadexplain').text("Click the Download link in the bottom-left to download this file.").appendTo(this._.detailsarea)
$('<div>').addClass('preview').addClass('downloadexplain centerable centertext').text("Click the Download link in the bottom-left to download this file.").appendTo(this._.detailsarea)
}
this._.filename.show()
this._.btns.show()
Expand Down

0 comments on commit 059f199

Please sign in to comment.