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
|
// of the post into the stream when the user hits reply. We therefore also
|
||||||
// need to enforce these rules on the .cooked version.
|
// need to enforce these rules on the .cooked version.
|
||||||
// Meanwhile, the server is busy post-processing the post and generating thumbnails.
|
// Meanwhile, the server is busy post-processing the post and generating thumbnails.
|
||||||
$('<style>#wmd-preview img:not(.thumbnail), .cooked img:not(.thumbnail) {' +
|
var style = Discourse.Mobile.mobileView ?
|
||||||
'max-width:' + Discourse.SiteSettings.max_image_width + 'px;' +
|
'max-width: 100%; height: auto;' :
|
||||||
'max-height:' + Discourse.SiteSettings.max_image_height + 'px;' +
|
'max-width:' + Discourse.SiteSettings.max_image_width + 'px;' +
|
||||||
'}</style>'
|
'max-height:' + Discourse.SiteSettings.max_image_height + 'px;';
|
||||||
).appendTo('head');
|
|
||||||
|
$('<style>#wmd-preview img:not(.thumbnail), .cooked img:not(.thumbnail) {' + style + '}</style>').appendTo('head');
|
||||||
},
|
},
|
||||||
|
|
||||||
click: function() {
|
click: function() {
|
||||||
|
|
Loading…
Reference in a new issue