MyBB Community Forums
[Pushed] max-width and max-height of img of editor not has any effect - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Development (https://community.mybb.com/forum-161.html)
+--- Forum: MyBB 1.8 Development (https://community.mybb.com/forum-165.html)
+---- Forum: 1.8 Bugs and Issues (https://community.mybb.com/forum-157.html)
+----- Forum: Pushed (https://community.mybb.com/forum-183.html)
+----- Thread: [Pushed] max-width and max-height of img of editor not has any effect (/thread-157321.html)



max-width and max-height of img of editor not has any effect - martec - 2014-08-11

Change made here:

https://github.com/mybb/mybb/commit/3e42dbe3a4e66b6377e0acd0378d19ce55f126f3

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#issuecomment-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/


RE: max-width and max-height of img of editor not has any effect - Destroy666 - 2014-08-11

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.


RE: max-width and max-height of img of editor not has any effect - martec - 2014-08-11

@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']}


RE: max-width and max-height of img of editor not has any effect - Destroy666 - 2014-08-11

(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.


RE: max-width and max-height of img of editor not has any effect - Eldenroot - 2014-08-11

Same problem in Chrome. Maybe should be added in 1.8


RE: max-width and max-height of img of editor not has any effect - martec - 2014-08-13

tested now here... and really not work for me...


RE: max-width and max-height of img of editor not has any effect - Destroy666 - 2014-08-13

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


RE: max-width and max-height of img of editor not has any effect - Andrew B. - 2014-08-21

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.


RE: max-width and max-height of img of editor not has any effect - sthag - 2014-08-22

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


RE: max-width and max-height of img of editor not has any effect - Destroy666 - 2014-08-22

@sthag, it has already been fixed and is awaiting merge,