Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

[wip] Feature: Resize column widths#210

Open
christinecha wants to merge 3 commits intockeditor:masterfrom
christinecha:t/3
Open

[wip] Feature: Resize column widths#210
christinecha wants to merge 3 commits intockeditor:masterfrom
christinecha:t/3

Conversation

@christinecha
Copy link

@christinecha christinecha commented Aug 21, 2019

https://github.com/ckeditor/ckeditor5-table/issues/3

A preliminary attempt at adding the feature to resize column widths.

  • Adds simple UI Element resizer to each cell
  • Adds new DOMEventObserver for mousemove and mouseup events
  • Adds colwidth attribute to TableCell and adds inline styles

Additional information

  • Why add a resizer to each cell? Well, mainly because I think it was the simplest way - you pretty much don't have to worry about complex CSS to make the UI work.
  • Why add inline styles to each cell? Why not just the first row? Well, that would work as you create a table, but then you'd lose all the styling if you deleted the top row (or else have to transfer all the attributes down to the next) which I think makes less sense.

Todo

  • Tests
  • I've introduced a new bug; seems to cause all sorts of problems now when you add an image inside of table cell. I don't know why that's happening yet.
  • Better UI? Maybe the cursor should remain ew-resize while dragging the whole time. Maybe the entire side of the column should "light up" too, not just the cell.
  • Do we need to specify a max width?
  • Currently, the text in the cell remains selected, and when you drag, it can make that selection keep changing. Not sure if we need to make the resizer itself selectable, and if so, what that means for the TableCell model.

@christinecha christinecha changed the title [wip] Feature: Resize Column widths [wip] Feature: Resize column widths Aug 21, 2019
@coveralls
Copy link

coveralls commented Aug 21, 2019

Coverage Status

Coverage decreased (-3.3%) to 96.717% when pulling b36b7db on christinecha:t/3 into 9f64452 on ckeditor:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants