Author Topic: Cursor above Signature when above the quote  (Read 3444 times)

Offline hce_

  • Newbie
  • *
  • Posts: 6
Cursor above Signature when above the quote
« on: March 05, 2013, 03:52:43 PM »
Hoping for some help sorting out cursor position in 0.8.5

My users would like their signature above the quote (Settings - Composing Messages - Signature Options... check) but then have their cursor appear ABOVE that signature. Currently, with "above the quote" selected in the Settings, the signature goes above the quote, but the cursor ends up at the bottom of the tinymce Compose window. With "below the quote" selected, the cursor appears (correctly) at the top of the tinymce window, but then the signature appears below the quote.

Is there anywhere to first position the signature above the quote, but then position the cursor above the signature (at the very top of the tinymce window) every time?

Thanks!

Offline ABerglund

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 673
Re: Cursor above Signature when above the quote
« Reply #1 on: March 05, 2013, 10:04:52 PM »
There are two settings involved. See attached.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

Offline hce_

  • Newbie
  • *
  • Posts: 6
Re: Cursor above Signature when above the quote
« Reply #2 on: March 06, 2013, 12:14:05 PM »
Thanks for your reply. Can confirm those are both already set.

This client has also required that the default double spacing in TinyMCE be removed, so pressing Enter results in a line break, not a new paragraph. To successfully accomplish this, I've added forced_root_block to TinyMCE's conf in the editor.js library, however, this seem to be the root cause of the cursor now defaulting to the bottom in the compose window.

Does the code that puts the cursor back to the top, "above" the signature, look for a paragraph tag to attach to? I poked around in the app.js.src file, but could not find anything too obvious to change.

Help please, devs? :)
« Last Edit: March 06, 2013, 12:15:45 PM by hce_ »

Offline ABerglund

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 673
Re: Cursor above Signature when above the quote
« Reply #3 on: March 06, 2013, 01:18:54 PM »
Ahh, yes, I can confirm that efforts to tweak TinyMCE to single-space in HTML will affect this. I was never able to get that to work without similar side-effects. I went back to the default line spacing and have told users to use shift-Enter when single space is needed. Not ideal, but more reliable in the long run.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

Offline hce_

  • Newbie
  • *
  • Posts: 6
Re: Cursor above Signature when above the quote
« Reply #4 on: March 06, 2013, 01:35:44 PM »
Yes, and in addition, it turns out that the "above signature" code does search for a paragraph tag to use at the beginning.

Therefor, to solve this while maintaining my TinyMCE conf, I added "<p></p>" to compose.inc immediately before the $MESSAGE_BODY about line 794. Inserts a blank paragraph tag to the top of the body for "above" code to find, while offering no negative side effects. (that I've found so far, anyway!)

Seems to be working now. Thanks everyone.