Ticket #1682: 1682.patch
File 1682.patch, 2.3 KB (added by , 16 years ago) |
---|
-
_whatsnew.html
75 75 are now properly sized in Opera.</li> 76 76 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking on radio 77 77 buttons or checkboxes in the editor in IE will no longer cause lockups in IE.</li> 78 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1682">#1682</a>] Editing control elements 79 in Firefox, Opera and Safari now works properly.</li> 78 80 </ul> 79 81 <p> 80 82 <a href="_whatsnew_history.html">See previous versions history</a> -
editor/_source/internals/fckselection_gecko.js
51 51 // element (object like and image or a table) is selected. 52 52 FCKSelection.GetSelectedElement = function() 53 53 { 54 var selectedElement = null ;55 56 54 var selection = !!FCK.EditorWindow && FCK.EditorWindow.getSelection() ; 55 if ( !selection || selection.rangeCount < 1 ) 56 return null ; 57 57 58 if ( selection && selection.anchorNode && selection.anchorNode.nodeType == 1 ) 59 { 60 if ( this.GetType() == 'Control' ) 61 { 62 // This one is good for all browsers, expect Safari Mac. 63 selectedElement = selection.anchorNode.childNodes[ selection.anchorOffset ] ; 58 var range = selection.getRangeAt( 0 ) ; 59 if ( range.startContainer != range.endContainer || range.startContainer.nodeType != 1 || range.startOffset != range.endOffset - 1 ) 60 return null ; 64 61 65 // For Safari (Mac only), the anchor node for a control selection is 66 // the control itself, which seams logic. FF and Opera use the parent 67 // as the anchor node, pointing to the control with the offset. 68 // As FF created the selection "standard", Safari would do better by 69 // following their steps. 70 if ( !selectedElement ) 71 selectedElement = selection.anchorNode ; 72 else if ( selectedElement.nodeType != 1 ) 73 return null ; 74 } 75 } 62 var node = range.startContainer.childNodes[ range.startOffset ] ; 63 if ( node.nodeType != 1 ) 64 return null ; 76 65 77 return selectedElement;66 return node ; 78 67 } 79 68 80 69 FCKSelection.GetParentElement = function()