1912 | | } |
1913 | | }; |
| 1913 | }, |
| 1914 | |
| 1915 | // Fix list selection range where entire range is selected from the inner side. |
| 1916 | // <ul><li>[...]</li></ul> => [<ul><li>...</li></ul>] |
| 1917 | fixListRange : (function() |
| 1918 | { |
| 1919 | function moveListBoundary( fixEnd ) |
| 1920 | { |
| 1921 | var listItem, listRoot; |
| 1922 | if ( ( listItem = this[ fixEnd ? 'endContainer' : 'startContainer' ].getAscendant( 'li', 1 ) ) |
| 1923 | && this.checkBoundaryOfElement( listItem, fixEnd ? CKEDITOR.END : CKEDITOR.START ) |
| 1924 | && ( listRoot = listItem.getParent() ) |
| 1925 | && ( listItem.equals( listRoot[ fixEnd ? 'getLast' : 'getFirst' ]( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) ) ) ) |
| 1926 | // Make the fix only when both sides are in same situation. |
| 1927 | && ( fixEnd || moveListBoundary.call( this, 1 ) ) ) |
| 1928 | { |
| 1929 | this[ fixEnd ? 'setEndAt' : 'setStartAt' ]( listRoot, fixEnd ? |
| 1930 | CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START ); |
| 1931 | return true; |
| 1932 | } |
| 1933 | } |
| 1934 | |
| 1935 | return function() |
| 1936 | { |
| 1937 | moveListBoundary.call( this ); |
| 1938 | }; |
| 1939 | })() |
| 1940 | }; |