? Success

User tests: Successful: Unsuccessful:

avatar ciar4n
ciar4n
18 Dec 2016

Summary of Changes

On larger screens, CodeMirror height seems small (300px) compared to the space available.

This PR...

  • Gives Codemirror a fluid height, increasing the working space when available.
  • Keeps a min-height of 300px
  • Ensures space remains above the fold for appending buttons (article edit)

Testing Instructions

Apply PR and open CodeMirror (template file edit, article edit)

Before Patch
codemirror1

After Patch
codemirror2

Documentation Changes Required

None

avatar ciar4n ciar4n - open - 18 Dec 2016
avatar ciar4n ciar4n - change - 18 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Dec 2016
Category Administration Templates (admin)
avatar dgt41
dgt41 - comment - 18 Dec 2016

@ciar4n if you can do the same for tinymce, I'll write a small snippet that will synchronise the value with the iframe...

avatar ciar4n
ciar4n - comment - 18 Dec 2016

@dgt41 Certainly worth considering. TinyMCE currently has quite a large height which in most cases extends beyond the viewport. Applying this change to it will effectively reduce its height in most cases.

To demonstrate how this change effects the CodeMirror editor ....

fluid2

Some might consider this an improvement with TinyMCE, others may not? Potentially this change allows the use of only one scroll bar rather than 2 when navigating to the end of a document.

avatar dgt41
dgt41 - comment - 18 Dec 2016

Some might consider this an improvement with TinyMCE, others may not

Actually this WAS a todo task for J4 in JAB2015, so most probably is the right way to go...

avatar ggppdk
ggppdk - comment - 18 Dec 2016

so most probably is the right way to go...

Yes, calc() will work on IE9+ and all other browsers too

  • IE8 will discard it, and just use the existing min-height value

calc() was used for site title of protostar too:
#13064

Finally lets start to making more use of it

A note about this PR,

  • the purpose is to the editor to have a height that matches the available viewport while being 400px smaller than it

Of course if the editor is at the bottom of some page, you will need to scroll the window to reveal of the editor
I just mention this case because it is not what the above animation shows

Continuing the above, i think it is preferable to use
height: calc(100vh - 330px);
or
height: calc(100vh - 240px);

so that we can get some real benefit in x768 and in x800 laptop screens
since: height: calc(100vh - 300px);
in those screens will give almost zero benefit because:
708 - 400 = 308 (on x768 screen)
740 - 400 = 340 (on x800 screen)

The user may need to scroll to put the editor inside viewport, if we use:
height: calc(100vh - 240px);
but anyway, if you place the editor at the bottom of page, you already need to scroll

and to avoid scroll in cases editor is near the top of the page:
height: calc(100vh - 330px);
is a good trade-off

avatar ciar4n
ciar4n - comment - 18 Dec 2016

@ggppdk The reasoning behind using 400 is that that is the approx height (plus a few px) from the top of the viewport to where the editor starts (inc. 'saved' alert).

To avoid double scroll bars on bigger screens and still allow a benefit to smaller screens I would suggest increasing the min-height rather than decreasing the calc value.

avatar ggppdk
ggppdk - comment - 18 Dec 2016

The reasoning behind using 400 is that that is the approx height (plus a few px) from the top of the viewport to where the editor starts (inc. 'saved' alert).

hhmm, the saved alert can be dismissed,
so still thinking that height: calc(100vh - 330px); may be a better trade-off

avatar ggppdk
ggppdk - comment - 18 Dec 2016

I have tested this item successfully on 67c0efc


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13266.

avatar ggppdk ggppdk - test_item - 18 Dec 2016 - Tested successfully
avatar ciar4n
ciar4n - comment - 18 Dec 2016

@ggppdk I can set to 330px however it would mean the appending buttons would appear below the fold. Personally I would sooner these buttons to be visible if the screen height allows it..

codemirror3

avatar ciar4n ciar4n - change - 18 Dec 2016
Labels Added: ?
avatar ggppdk
ggppdk - comment - 18 Dec 2016

Ok, this is only a common screen, the backend article edit screen,

But if the editor is shown at the middle or bottom of the page,
-- not only the buttons, but the editor itself will not be visible without doing some scrolling

That is even if using the minimum 300px,
-- the user will still need to scroll in order to put it (=the editor) inside the view port

But as i said i understand that you want to catch the common case of most backend screens,
that the editor is near the top and indeed -400px makes it show in full

avatar ciar4n
ciar4n - comment - 19 Dec 2016

@ggppdk Min-height has been increased to 400px. I feel we are over complicating a relatively simple PR. As this PR only effects Isis, the editor will never appear closer to the top of the screen, nor will this PR effect the frontend. The value has been set to accommodate the majority of instances of the editor within the viewport. If the editor is further down the page then there is an argument for reducing the height further rather than increasing it. Considering this I set a max-height.

@dgt41 I will leave TinyMCE for another PR as I am not sure how the JS will effect the option to resize.

avatar ggppdk
ggppdk - comment - 21 Dec 2016

I have tested this item successfully on 7f19f96


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13266.

avatar ggppdk ggppdk - test_item - 21 Dec 2016 - Tested successfully
avatar zero-24
zero-24 - comment - 21 Dec 2016

I have tested this item successfully on 7f19f96

Great ?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13266.

avatar zero-24 zero-24 - test_item - 21 Dec 2016 - Tested successfully
avatar zero-24 zero-24 - change - 21 Dec 2016
Milestone Added:
avatar zero-24 zero-24 - change - 21 Dec 2016
Milestone Added:
Status Pending Ready to Commit
Labels Added: ?
avatar zero-24
zero-24 - comment - 21 Dec 2016

Great. RTC now.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13266.

avatar rdeutz rdeutz - reference | 5ea9b0e - 21 Dec 16
avatar rdeutz rdeutz - merge - 21 Dec 2016
avatar rdeutz rdeutz - close - 21 Dec 2016
avatar rdeutz rdeutz - change - 21 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-21 21:49:56
Closed_By rdeutz
Labels
avatar rdeutz rdeutz - close - 21 Dec 2016
avatar rdeutz rdeutz - merge - 21 Dec 2016
avatar cpfeifer cpfeifer - reference | fb3e6ba - 22 Dec 16

Add a Comment

Login with GitHub to post a comment