-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#842] Fix for indention list troubles #872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works fine, just few small adjustments needed.
Please also update PR target branch to major
(and reabse).
plugins/indentlist/plugin.js
Outdated
@@ -174,7 +174,19 @@ | |||
listArray[ i ].indent += indentOffset; | |||
// Make sure the newly created sublist get a brand-new element of the same type. (http://dev.ckeditor.com/ticket/5372) | |||
if ( indentOffset > 0 ) { | |||
var listRoot = listArray[ i ].parent; | |||
var listRoot; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While further in the code you are checking:
if ( listRoot === undefined ) {
listRoot = listArray[ i ].parent;
}
why not initialize var listRoot = listArray[ i ].parent;
so it already has default value which alternatively will be overwritten inside the for
loop.
plugins/indentlist/plugin.js
Outdated
var listRoot = listArray[ i ].parent; | ||
var listRoot; | ||
|
||
for ( var j = i - 1; j >= 0; j-- ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comment with the issue reference could be useful here so it is clear what is the exact purpose of this loop.
|
||
1. Put caret in paragraph with `333`. | ||
1. Use `Decrease indent` to move paragraph to the left. | ||
1. Use `Increase indent` to move paragraph to the right. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with:
Use
Decrease indent
button to move list item to the right.
1. Use `Decrease indent` to move paragraph to the left. | ||
1. Use `Increase indent` to move paragraph to the right. | ||
|
||
**Expected:** List item with `333` has circle as a list tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... has a circle as a list bullet.
@@ -0,0 +1,14 @@ | |||
@bender-tags: 4.7.3, 842, bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update target version tag to 4.8.0.
- little code optimization - adding code comments - typo and tag fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
What is the purpose of this pull request?
Bug fix
Does your PR contain necessary tests?
All patches which change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
What changes did you make?
close #842