Bug #21837 » rtehtmlarea_bugfix_13004_trunk.patch
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js (copie de travail) | ||
---|---|---|
|
||
/*
|
||
* This function gets called by the main editor event handler when a key was pressed.
|
||
* It will process the enter key for IE when buttons.table.disableEnterParagraphs is set in the editor configuration
|
||
* It will process the enter key for IE and Opera when buttons.table.disableEnterParagraphs is set in the editor configuration
|
||
*/
|
||
onKeyPress : function (ev) {
|
||
if (HTMLArea.is_ie && ev.keyCode == 13 && !ev.shiftKey && this.disableEnterParagraphs) {
|
||
if ((HTMLArea.is_ie || HTMLArea.is_opera) && ev.keyCode == 13 && !ev.shiftKey && this.disableEnterParagraphs) {
|
||
var selection = this.editor._getSelection();
|
||
var range = this.editor._createRange(selection);
|
||
var parentElement = this.editor.getParentElement(selection, range);
|
||
... | ... | |
parentElement = parentElement.parentNode;
|
||
}
|
||
if (/^(td|th)$/i.test(parentElement.nodeName)) {
|
||
range.pasteHTML("<br />");
|
||
if (HTMLArea.is_ie) {
|
||
range.pasteHTML("<br />");
|
||
} else {
|
||
var brNode = this.editor._doc.createElement("br");
|
||
this.editor.insertNodeAtSelection(brNode);
|
||
this.editor.selectNode(brNode, false);
|
||
}
|
||
return false;
|
||
}
|
||
}
|