Skip to content

Commit 59e5bf6

Browse files
daemon1024jywarren
andauthored
Fix odd looking uploaded main images (#612)
* fix thumbnail image height instead of width * center uploaded main images Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
1 parent 8af2b84 commit 59e5bf6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

dist/PublicLab.Editor.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@
181181
height: 180px;
182182
width: 720px;
183183
margin-bottom: 10px;
184+
display: flex;
185+
justify-content: center;
184186
}
185187

186188
.mainImageBox.dragDrop {

src/modules/PublicLab.MainImageModule.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ module.exports = PublicLab.MainImageModule = PublicLab.Module.extend({
2525
_module.image.onload = function() {
2626
var heightDropdown = this.height;
2727
var widthDropdown = this.width;
28-
if (this.width > 340) {
29-
var aspectRatio = this.width / 340;
30-
widthDropdown = 340;
31-
heightDropdown = this.height / aspectRatio;
28+
if (this.height > 180) {
29+
var aspectRatio = this.height / 180;
30+
widthDropdown = this.width / aspectRatio; ;
31+
heightDropdown = 180;
3232
}
3333
_module.dropEl.css('height', heightDropdown);
3434
_module.dropEl.css('width', widthDropdown);

0 commit comments

Comments
 (0)