Changeset 2171
- Timestamp:
- 2008-07-04 09:00:18 (6 months ago)
- Location:
- FCKeditor/branches/features/div_container/editor
- Files:
-
- 3 modified
-
dialog/fck_div.html (modified) (1 diff)
-
_source/internals/fck_contextmenu.js (modified) (1 diff)
-
_source/internals/fckselection_gecko.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/div_container/editor/dialog/fck_div.html
r2105 r2171 38 38 var AlwaysCreate = dialog.Args().CustomValue ; 39 39 40 var ActiveEl = !AlwaysCreate ? dialog.Selection.GetSelection().MoveToAncestorNode( 'DIV' ) : null ; 41 if ( ActiveEl ) 42 { 43 ActiveEl = ( new FCKElementPath( ActiveEl ) ).BlockLimit ; 40 var ActiveEl = null ; 41 if ( !AlwaysCreate ) 42 { 43 var oSelection = dialog.Selection.GetSelection() ; 44 ActiveEl = ( new FCKElementPath( oSelection.GetSelectedElement() || oSelection.GetParentElement() ) ).BlockLimit ; 44 45 if ( ActiveEl && ActiveEl.nodeName.toLowerCase() != 'div' ) 45 46 ActiveEl = null ; -
FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js
r2121 r2171 298 298 AddItems : function( menu, tag, tagName ) 299 299 { 300 var path = new FCKElementPath( FCKSelection.Get ParentElement() ) ;300 var path = new FCKElementPath( FCKSelection.GetSelectedElement() || FCKSelection.GetParentElement() ) ; 301 301 if ( path.BlockLimit && path.BlockLimit.nodeName.IEquals( 'div' ) ) 302 302 { -
FCKeditor/branches/features/div_container/editor/_source/internals/fckselection_gecko.js
r2072 r2171 76 76 if ( oSel ) 77 77 { 78 // make the common case fast - for collapsed/nearly collapsed selections just return anchor.parent. 78 // if anchorNode == focusNode, see if the selection is text only or including nodes. 79 // if text only, return the parent node. 80 // if the selection includes DOM nodes, then the anchorNode is the nearest container. 79 81 if ( oSel.anchorNode && oSel.anchorNode == oSel.focusNode ) 80 return oSel.anchorNode.parentNode ; 82 { 83 var oRange = oSel.getRangeAt( 0 ) ; 84 if ( oRange.collapsed || oRange.startContainer.nodeType == 3 ) 85 return oSel.anchorNode.parentNode ; 86 else 87 return oSel.anchorNode ; 88 } 81 89 82 90 // looks like we're having a large selection here. To make the behavior same as IE's TextRange.parentElement(),