Ticket #3684: 3684_3.patch
File 3684_3.patch, 1.6 KB (added by , 15 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
130 130 selection = evt.data.selection, 131 131 range = selection.getRanges()[0], 132 132 body = editor.document.getBody(), 133 enterMode = editor.config.enterMode; 133 enterMode = editor.config.enterMode, 134 enterBlockName = enterMode == CKEDITOR.ENTER_P ? 'p' : 'div'; 134 135 135 136 // When enterMode set to block, we'll establing new paragraph only if we're 136 137 // selecting inline contents right under body. (#3657) … … 154 155 } 155 156 156 157 selection.selectBookmarks( bms ); 157 } 158 159 // If the fixed block is blank and is already followed by a enter block, 160 // we should drop it and move to the next block(#3684). 161 var children = fixedBlock.getChildren(), 162 count = children.count(), 163 firstChild, 164 previousElement = fixedBlock.getPrevious( true ), 165 nextElement = fixedBlock.getNext( true ), 166 enterBlock; 167 if ( previousElement.is( enterBlockName ) ) 168 enterBlock = previousElement; 169 else if ( nextElement.is ( enterBlockName ) ) 170 enterBlock = nextElement; 171 172 if( ( !count 173 || ( firstChild = children.getItem( 0 ) ) && firstChild.is && firstChild.is( 'br' ) ) 174 && enterBlock ) 175 { 176 fixedBlock.remove(); 177 range.moveToElementEditStart( enterBlock ); 178 range.select(); 179 } 180 } 158 181 159 182 // Inserting the padding-br before body if it's preceded by an 160 183 // unexitable block.