Fixed enabling of Split Cell command

This commit is contained in:
cmanske%netscape.com 2000-05-17 03:06:06 +00:00
Родитель 0f8537dc64
Коммит 4cf9d321c5
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -838,7 +838,8 @@ function IsInTableCell()
function IsSelectionInOneCell()
{
var selection = window.editorShell.selection;
var selection = window.editorShell.editorSelection;
if (selection && selection.rangeCount == 1)
{
// We have a "normal" single-range selection
@ -848,7 +849,7 @@ function IsSelectionInOneCell()
// Check if both nodes are within the same cell
var anchorCell = window.editorShell.GetElementOrParentByTagName("td", selection.anchorNode);
var focusCell = window.editorShell.GetElementOrParentByTagName("td", selection.focusNode);
return (focusCell && anchorCell && focusCell == anchorCell);
return (focusCell != null && anchorCell != null && (focusCell == anchorCell));
}
// Collapsed selection or anchor == focus (thus must be in 1 cell)
return true;