Issue Bug Closed

#78293rtehtmlarea Javascript not working

Uwe Harnischmacher 10/14/16, 10:37 updated 10/20/17, 13:47

Description

For me the custom RTE.anchorClasses.[xxx].titleText is not working. In the debugging process I found an error in sysext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js. The condition

if (document.ltargetform.ltarget && document.getElementById('ltargetrow').style.display === 'none')

will throw the error because of document.getElementById(‘ltargetrow’) is null.
Searching the source reveals that in my rtehtmlarea Version 7.6.0 no row with that id is set up. In rtehtmlarea version 6.2.0 the tr with the input field for the target had this id. As I do not want to hide the option to select the target it works for me to just comment out these lines

else if (document.ltargetform.ltarget && document.getElementById('ltargetrow').style.display === 'none') {
                            // Reset target to default if field is not displayed and class has no configured target
                            document.ltargetform.ltarget.value = RteLinkBrowser.defaultLinkTarget;
                        }

This solution probably will not work in general as I did not know if there is a possibility to hide the target-selection option and if so how it is done.

That do not solves my titleText issue but the javascript throws no error anymore.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.