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