mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
BUGFIX: properly enforce image dimensions on mobile
This commit is contained in:
parent
fc12091a93
commit
b0d1bd1c3a
1 changed files with 6 additions and 5 deletions
|
@ -128,11 +128,12 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||
// of the post into the stream when the user hits reply. We therefore also
|
||||
// need to enforce these rules on the .cooked version.
|
||||
// Meanwhile, the server is busy post-processing the post and generating thumbnails.
|
||||
$('<style>#wmd-preview img:not(.thumbnail), .cooked img:not(.thumbnail) {' +
|
||||
'max-width:' + Discourse.SiteSettings.max_image_width + 'px;' +
|
||||
'max-height:' + Discourse.SiteSettings.max_image_height + 'px;' +
|
||||
'}</style>'
|
||||
).appendTo('head');
|
||||
var style = Discourse.Mobile.mobileView ?
|
||||
'max-width: 100%; height: auto;' :
|
||||
'max-width:' + Discourse.SiteSettings.max_image_width + 'px;' +
|
||||
'max-height:' + Discourse.SiteSettings.max_image_height + 'px;';
|
||||
|
||||
$('<style>#wmd-preview img:not(.thumbnail), .cooked img:not(.thumbnail) {' + style + '}</style>').appendTo('head');
|
||||
},
|
||||
|
||||
click: function() {
|
||||
|
|
Loading…
Reference in a new issue