Labels |
Added:
?
|
Status | New | ⇒ | Discussion |
Labels |
Added:
?
|
One gets this wrong alert when the readmore is added in an empty textarea, otherwise it works fine.
The js does not take into account an empty textarea.
var content = window.Joomla.editors.instances[editor].getValue();
if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
} else {
// TODO replace with joomla-alert
alert(options.exists);
return false;
}
After modifying to
var content = window.Joomla.editors.instances[editor].getValue();
if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
}
else if (!content) {
Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
} else {
// TODO replace with joomla-alert
alert(options.exists);
return false;
}
we have no more error and get the same behavior as in 3.x
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-08-16 16:33:37 |
Closed_By | ⇒ | infograf768 |
confirmed