MyBB Community Forums

Full Version: max-width and max-height of img of editor not has any effect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Change made here:

https://github.com/mybb/mybb/commit/3e42...ce55f126f3

not has any effect...

Image in editor not scaled...

To this work need put this code below

img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
	width: auto;
}

in /jscripts/sceditor/jquery.sceditor.mybb.css

Why of this i already said here https://github.com/mybb/mybb/pull/965#is...t-49506075

And if need Make style of editor textarea (jquery.sceditor.mybb.css) dependent with theme of editor check this http://community.mybb.com/thread-156662.html



What documentation of sceditor said about style option:

[Image: qT7QX12.png]

http://www.sceditor.com/documentation/options/
Scaling seems to work for me in the default latest github version, in Chrome at least.

Anyways, I agree that implementing this: http://community.mybb.com/thread-156662.html would be most likely good. One CSS file to load less and full theme editor split in opposite to the current messy 50% for all themes and 50% separated. But that's for 1.8.1.
@Destroy666

strange i downloaded today of github and tested...
for me not work...

using chrome too...

http://www.dailymotion.com/video/x23biy9_test2_tech

(2014-08-11, 11:49 AM)Destroy666 Wrote: [ -> ]Scaling seems to work for me in the default latest github version, in Chrome at least.

Anyways, I agree that implementing this: http://community.mybb.com/thread-156662.html would be most likely good. One CSS file to load less and full theme editor split in opposite to the current messy 50% for all themes and 50% separated. But that's for 1.8.1.

not reduce file to load...
jquery.sceditor.{$theme['editortheme']} different of {$theme['editortheme']}
(2014-08-11, 12:06 PM)martec Wrote: [ -> ]not reduce file to load...
jquery.sceditor.{$theme['editortheme']} different of {$theme['editortheme']}

Oops, I partially misunderstood your thread. Well, the 2nd part still applies though - both files should be splitted, otherwise it's a mess.

I'll try to reproduce it again later.
Same problem in Chrome. Maybe should be added in 1.8
tested now here... and really not work for me...
I see, had some uncomitted changes locally. Pushed to github manually as the button doesn't work yet: https://github.com/mybb/mybb/issues/1188
When the image exceeds the width of the editor, scale the whole photo until the width fits.  Scaling down means the that as the width gets smaller, so does the height, but ratio remains the same. But it is not necessary to make the height fit the editor window. It is normal for editors to have to scroll up and down.
I added the following code to the file jscripts > sceditor > jquery.sceditor.mybb.css and it works for me:

img {
	max-width: 100%;
	height: auto;
}

It is important to not use width: 100% because the image would then always be sized. Even above the actual dimension.
If an aspect ratio correct scaling should be achieved with css it is good to set the width and just let the height be adjusted with height: auto
@sthag, it has already been fixed and is awaiting merge,