• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Odd redactor issue

Neil E.

Active member
#1
Earlier I posted about styling the redactor box (http://xenforo.com/community/threads/redactor-styling-elements.60160/) and Brogan pointed out how clicking in the text field changes focus and the selected buttons no longer highlight. There is a different problem happening.

Based on the default package (this support forum) I can use the redactor box to create a reply.
Step one, click on bold, start typing = created text in bold, bold button stays highlighted
Step two, click on italics, keep typing = created text in bold italics, both buttons stay highlighted
Step three, click on underline, keep typing = created text in underlined bold italics, all buttons stay highlighted
Step four, click on strike through, keep typing = created text in struck through underlined bold italics, all buttons highlighted.
Step five, backspace the cursor, each button turns off as the text style disappears.
This works OK.

In my style, when I do exactly the same thing, the button highlights disappear as soon as text is created. No clicking is done in the text area so there should be no "loss of focus". I have gone back into EXTRA and removed any CSS related to the redactor box. There is no styling done via the Rich Text Editor section in Styling Properties. As far as I can see there is nothing set that would have any bearing on the redactor box, but I still get the button highlight problem. Has anyone else run into this situation?
 

Neil E.

Active member
#2
So I went to http://imperavi.com/redactor/ and had a look at their examples. When I tried their text entry fields (their examples already have text inserted) I got the same action as my problem. The buttons did not remain highlighted. So now I'm baffled and it makes me wonder if Mike has tweaked the code so the XF redactor works differently. The redactor change log http://imperavi.com/redactor/log/ shows frequent modifications.
 
Last edited:

Mike

XenForo developer
Staff member
#4
There are A LOT of modifications and we use a very different version. Looking at the original version of Redactor won't really give you much indication about XF's implementation.

You'll want to take your site back to the default (default style, no add-ons, no file modifications), confirm that the behavior and then build up until the problem comes back so you can determine the cause.
 

Neil E.

Active member
#5
I assume "default style" just means deselecting a modified style and selecting the default style.
"no file modifications" will be the tricky part. I have a lot of direct template edits that will be very time consuming to restore later.
Is there a quick way to do this? Does exporting a style include all custom phrase changes?
Changed phrases don't show up in Customized Components.
 

Neil E.

Active member
#10
Successfully updated to 1.2.2 and still have the same behaviour whereby the button highlights go out when text is entered.

This happens on the default style (no modifications present).

Click on bold, button highlights, highlight disappears as soon as I type.

This support forum, this point in message, click on bold (now), the highlight stays on. Click on bold, highlight off.
 

Tracy Perry

Well-known member
#11
Successfully updated to 1.2.2 and still have the same behaviour whereby the button highlights go out when text is entered.

This happens on the default style (no modifications present).

Click on bold, button highlights, highlight disappears as soon as I type.

This support forum, this point in message, click on bold (now), the highlight stays on. Click on bold, highlight off.
OK... I "think" I've figured this out. I was using the locally hosted jQuery. Changed over to the Google Ajax API CDN and it started working on my forums. Are you using the locally hosted jQuery?

EDIT: Weird... it's working with the locally hosted one on ONE of my forums - but using a different forum I have (on a separate server) I had to use the Google one.

EDIT 2: And now I went back to the locally hosted on the forum I was having the same problem with and it's now working there also. Caching issue?
 

Neil E.

Active member
#12
I think you are right. Different browser (IE) I get the expected function. Firefox still gives me the wierd results despite clearing the cache.
Completely different computer (IE), also works correctly. I'm not going to worry about it at this point. I only looked at the button action after styling the redactor so I thought my changes must have done something.