Skip to content
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

Merged
merged 5 commits into from
Sep 18, 2017
Merged

[#842] Fix for indention list troubles #872

merged 5 commits into from
Sep 18, 2017

Conversation

msamsel
Copy link
Contributor

@msamsel msamsel commented Sep 6, 2017

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

  • Unit tests
  • Manual tests

What changes did you make?

  • Change way how is found proper list tag, when list item increases indent.

close #842

Copy link
Contributor

@f1ames f1ames left a 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).

@@ -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;
Copy link
Contributor

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.

var listRoot = listArray[ i ].parent;
var listRoot;

for ( var j = i - 1; j >= 0; j-- ) {
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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.

Mateusz Samsel added 3 commits September 15, 2017 11:14
- little code optimization
- adding code comments
- typo and tag fixes
@msamsel msamsel changed the base branch from master to major September 15, 2017 09:14
@f1ames f1ames self-requested a review September 18, 2017 09:08
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@f1ames f1ames merged commit 78e340f into major Sep 18, 2017
@f1ames f1ames deleted the t/842 branch September 18, 2017 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List Style not restored when toggling indent level
2 participants