Skip to content

Commit 059f199

Browse files
committed
Rearrange center handling css and fix centering of video and audio.
1 parent 4f32f36 commit 059f199

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

Diff for: client/css/up1.css

+7-4
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@
136136
max-width: 100%;
137137
}
138138

139-
#previewimg img {
139+
#previewimg img, .preview video, .preview audio {
140140
display: block;
141141
margin: 0 auto;
142142
}
143143

144-
#previewimg img:not(.dragged) {
144+
#previewimg img:not(.dragged), .preview audio, .preview video {
145145
max-height: 100vh;
146146
max-width: 100vw;
147147
}
@@ -324,11 +324,14 @@
324324
white-space: nowrap;
325325
}
326326

327-
audio.preview,video.preview,.downloadexplain,#downloadprogress,#previewimg {
327+
.centertext {
328+
text-align: center;
329+
}
330+
331+
.centerable {
328332
-webkit-transform: translateY(-50%);
329333
margin: 0 auto;
330334
position: relative;
331-
text-align: center;
332335
top: 50%;
333336
transform: translateY(-50%);
334337
}

Diff for: client/js/download.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ upload.modules.addmodule({
7979
this._.editpaste.hide()
8080
this._.newupload.hide()
8181
this._.content = {}
82-
this._.content.main = this._.content.loading = $('<h1>').prop('id', 'downloadprogress').text('Downloading')
82+
this._.content.main = this._.content.loading = $('<h1>').prop('id', 'downloadprogress').addClass('centertext centerable').text('Downloading')
8383
this._.detailsarea.empty().append(this._.content.main)
8484
this._.deletebtn.hide()
8585
upload.updown.download(content, this.progress.bind(this), this.downloaded.bind(this))
@@ -192,7 +192,7 @@ upload.modules.addmodule({
192192
}
193193

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

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

226226
this._.editpaste.show()
227227
} else if (association == 'video') {
228-
$('<video>').addClass('preview').prop('controls', true).prop('autoplay', true).appendTo(this._.detailsarea).prop('src', url)
228+
$('<div>').addClass('preview centerable').append($('<video>').prop('controls', true).prop('autoplay', true).prop('src', url)).appendTo(this._.detailsarea)
229229
} else if (association == 'audio') {
230-
$('<audio>').addClass('preview').prop('controls', true).prop('autoplay', true).appendTo(this._.detailsarea).prop('src', url)
230+
$('<div>').addClass('preview centerable').append($('<audio>').prop('controls', true).prop('autoplay', true).prop('src', url)).appendTo(this._.detailsarea)
231231
} else {
232-
$('<div>').addClass('preview').addClass('downloadexplain').text("Click the Download link in the bottom-left to download this file.").appendTo(this._.detailsarea)
232+
$('<div>').addClass('preview').addClass('downloadexplain centerable centertext').text("Click the Download link in the bottom-left to download this file.").appendTo(this._.detailsarea)
233233
}
234234
this._.filename.show()
235235
this._.btns.show()

0 commit comments

Comments
 (0)