mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Add tab nesting capability to list items with text in them;
- This requires your cursor to be at the beginning of the list item. - This implementation mimics Google Docs.
This commit is contained in:
parent
0c87def58c
commit
aa7311195f
1 changed files with 2 additions and 3 deletions
|
@ -381,15 +381,14 @@ var keyHandlers = {
|
|||
self._removeZWS();
|
||||
// If no selection and in an empty block
|
||||
if ( range.collapsed &&
|
||||
rangeDoesStartAtBlockBoundary( range ) &&
|
||||
rangeDoesEndAtBlockBoundary( range ) ) {
|
||||
rangeDoesStartAtBlockBoundary( range ) ) {
|
||||
node = getStartBlockOfRange( range );
|
||||
// Iterate through the block's parents
|
||||
while ( parent = node.parentNode ) {
|
||||
// If we find a UL or OL (so are in a list, node must be an LI)
|
||||
if ( parent.nodeName === 'UL' || parent.nodeName === 'OL' ) {
|
||||
// AND the LI is not the first in the list
|
||||
if ( node.previousSibling ) {
|
||||
if ( node.previousSibling || node.parentNode.nodeName === 'LI' ) {
|
||||
// Then increase the list level
|
||||
event.preventDefault();
|
||||
self.modifyBlocks( increaseListLevel, range );
|
||||
|
|
Loading…
Reference in a new issue