Ticket #4129: 4129.patch

File 4129.patch, 2.8 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/list/plugin.js

     
    402402                                                ranges[ 0 ].selectNodeContents( paragraph );
    403403                                        selection.selectRanges( ranges );
    404404                                }
    405                         }
     405                                // Maybe a single range there enclosing the whole list,
     406                                // turn on the list state manually(#4129).
     407                                else
     408                                {
     409                                        var range = ranges.length == 1 && ranges[ 0 ],
     410                                                enclosedNode = range && range.getEnclosedNode();
     411                                        if ( enclosedNode && enclosedNode.is
     412                                                && this.type == enclosedNode.getName() )
     413                                        {
     414                                                setState.call( this, editor, CKEDITOR.TRISTATE_ON );
     415                                        }
     416                                }
     417                        }
    406418
    407419                        var bookmarks = selection.createBookmarks( true );
    408420
  • _source/core/dom/range.js

     
    16101610                                return false;
    16111611                },
    16121612
     1613                /**
     1614                 * Get the single node enclosed within the range if there's one.
     1615                 */
     1616                getEnclosedNode : function()
     1617                {
     1618                        var walkerRange = this.clone(),
     1619                                walker = new CKEDITOR.dom.walker( walkerRange ),
     1620                                isNotBookmarks = CKEDITOR.dom.walker.bookmark( true ),
     1621                                isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ),
     1622                                evaluator = function( node )
     1623                                {
     1624                                        return isNotWhitespaces( node ) && isNotBookmarks( node );
     1625                                };
     1626                        walkerRange.evaluator = evaluator;
     1627                        var node = walker.next();
     1628                        walker.reset();
     1629                        var previous = walker.previous();
     1630                        return previous.equals( node ) ? node : null;
     1631                },
     1632
    16131633                getTouchedStartNode : function()
    16141634                {
    16151635                        var container = this.startContainer ;
  • _source/core/dom/walker.js

     
    304304                        lastBackward : function()
    305305                        {
    306306                                return iterateToLast.call( this, true );
     307                        },
     308
     309                        reset : function()
     310                        {
     311                                delete this.current;
     312                                this._ = {};
    307313                        }
    308314
    309315                }
  • CHANGES.html

     
    219219                <li><a href="http://dev.fckeditor.net/ticket/4145">#4145</a> : Fixed the on demand
    220220                        (&quot;basic&quot;) loading model of the editor.</li>
    221221                <li><a href="http://dev.fckeditor.net/ticket/4139">#4139</a> : Fixed list plugin regression of [3903].</li>
     222                <li><a href="http://dev.fckeditor.net/ticket/4129">#4129</a> : Fixed unable to remove single list wihtin document with Ctrl-A.</li>
    222223        </ul>
    223224        <h3>
    224225                CKEditor 3.0 RC</h3>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy