Ticket #3849: 3849.patch
File 3849.patch, 2.9 KB (added by , 15 years ago) |
---|
-
_source/plugins/selection/plugin.js
943 943 function() 944 944 { 945 945 var collapsed = this.collapsed; 946 var isStartMa kerAlone;946 var isStartMarkerAlone; 947 947 var dummySpan; 948 948 949 949 var bookmark = this.createBookmark(); … … 976 976 } 977 977 else 978 978 { 979 // The isStartMakerAlone logic comes from V2. It guarantees that the lines 980 // will expand and that the cursor will be blinking on the right place. 981 // Actually, we are using this flag just to avoid using this hack in all 982 // situations, but just on those needed. 979 // The isStartMarkerAlone logic comes from V2. It guarantees that the lines 980 // will expand and that the cursor will be blinking on the right place. 981 // Actually, we are using this flag just to avoid using this hack in all 982 // situations, but just on those needed. 983 isStartMarkerAlone = !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ); 983 984 984 // But, in V3, somehow it is not interested on working whe hitting SHIFT+ENTER985 // inside text. So, let's jsut leave the hack happen always.986 987 // I'm still leaving the code here just in case. We may find some other IE988 // weirdness and uncommenting this stuff may be useful.989 990 // isStartMakerAlone = ( !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ) )991 // && !startNode.hasNext();992 993 985 // Append a temporary <span></span> before the selection. 994 986 // This is needed to avoid IE destroying selections inside empty 995 987 // inline elements, like <b></b> (#253). … … 999 991 dummySpan.setHtml( '' ); // Zero Width No-Break Space (U+FEFF). See #1359. 1000 992 dummySpan.insertBefore( startNode ); 1001 993 1002 // if ( isStartMakerAlone )1003 //{994 if ( isStartMarkerAlone ) 995 { 1004 996 // To expand empty blocks or line spaces after <br>, we need 1005 997 // instead to have any char, which will be later deleted using the 1006 998 // selection. 1007 999 // \ufeff = Zero Width No-Break Space (U+FEFF). (#1359) 1008 1000 this.document.createText( '\ufeff' ).insertBefore( startNode ); 1009 //}1001 } 1010 1002 } 1011 1003 1012 1004 // Remove the markers (reset the position, because of the changes in the DOM tree). … … 1015 1007 1016 1008 if ( collapsed ) 1017 1009 { 1018 // if ( isStartMakerAlone )1019 //{1010 if ( isStartMarkerAlone ) 1011 { 1020 1012 // Move the selection start to include the temporary \ufeff. 1021 1013 ieRange.moveStart( 'character', -1 ); 1022 1014 … … 1024 1016 1025 1017 // Remove our temporary stuff. 1026 1018 this.document.$.selection.clear(); 1027 //}1028 //else1029 //ieRange.select();1019 } 1020 else 1021 ieRange.select(); 1030 1022 1031 1023 dummySpan.remove(); 1032 1024 }