Open kousu opened 8 years ago
I can't remember now, but I feel like there's a reason. Also, i believe that code was around before things like flexbox. I mean, best would probably just be to use Flexbox and let it handle all the calculations of 50% and stuff if you can
In short: EpicEditor sets its size statefully, at init, in pixels, and I think this is wrong.
I am trying to use EpicEditor for a progressive enhancement over a textarea. If javascript is missing, the textarea should work. If javascript is available, EpicEditor should load, with
options = {textarea: "post_content"}
.Since EpicEditor generates a separate iframe instead of styling the textarea, I have both but hide the EpicEditor div unless javascript exists to flip it:
Then I use this javascript to linkup the two:
But this doesn't work, because EpicEditor seems to be interpreting "display: none" as "width: 0px; height: 0px", and it does it like turtles all the way down:
There are at least four tags there that have been zapped to zero size. When
happens, EpicEditor sets
#epiceditor { width: 100%; }
but ignores height, and even if it didn't it would have to find all the subelements that it zapped and undo their zappiness.I can work around this to get progressive enhancement working, but the bigger issue is that state gets recorded by the script instead of just letting CSS rules handle it. Is there a reason percentage-sizing is a bad idea?