111 Commits

Author SHA1 Message Date
57ec53a8ed doc: add js-docs to appease eslint 2018-01-04 17:59:27 +01:00
b594735c7a fix: toolbar works again after adding row or column
Not sure why, but after inserting a new row or column a new textarea is
generated and used. We need to adjust for that.
2018-01-04 17:54:13 +01:00
6ecdab9899 fix: moving rows should work more correctly now
Handsontable always applies the "move" operation to the supplied data
array, hence we always denied the move operation for handsontable and
instead update it with a moved data array.

I'm not sure why the `target += 1` was introduced, but it caused wrong
behavior which was fixed by removing it.
2018-01-04 17:54:03 +01:00
a9aeadc56e fix: context-menu out of sync after move
Moving a row, changes the object the `meta` variable points to. However
the context-menu got its own reference to the initial object when it
was initialized. Hence after a move, these two were out of sync. By
providing getters to the context menu, it should always have access to
the object the current meta variable is referencing.
2017-11-08 13:30:25 +01:00
b075fc9d0f fix: ensure this.data references same object as data
In the beginning handsontable_config.data is set to the object in the
data variable. However if that data variable is assigned a new object,
then these two are out of sync.

This results in errors, for example the deletion of a row would than no
longer remove that row from the data variable (only from
handsontable_config.data, which is a different object).

APL-60
2017-11-08 13:28:13 +01:00
30db86565f fix: correctly add rows to meta
This fixes a bug, that caused the meta data of the rows following an
inserted row to shift 1 row down.
2017-09-07 17:41:02 +02:00
ca633f2dea fix: don't double count when creating new rows
This becomes relevant when pasting content which is much larger than the
table.
2017-09-06 13:41:07 +02:00
92083d79aa style: add valid jsdoc for parameters 2017-09-05 13:44:46 +02:00
ad47c8546b style: make global variables explicit 2017-09-05 11:35:41 +02:00
23291d09c4 style: eslint fixes
This is mostly indentation and double->single quotes. It includes
turning qunit env on for qunit test-files and disabling no-magic-numbers
for a test-file that is all about moving a row from position one to
position two and back again.
2017-09-04 20:21:47 +02:00
6657fb97c2 added eslint
we have to decide if that's better than jshint or if we need both.
2017-08-28 16:38:44 +02:00
00a0cef2f0 fix: make user unable to delete all rows/cols
This should fix #109
2017-08-15 12:47:54 +02:00
258b57eec6 fix: moves are disabled with a different mechanism 2017-08-10 17:10:50 +02:00
44ed7a88cb refactor: remove unneeded code
One can no longer select individual rows/cols that are part of a merge.
Thus one cannot delete rows/cols that are part of a merge but only all
rows connected to the merge.
2017-08-10 17:00:43 +02:00
1d94014e1a feat: Extend table when pasting larger data
Please note that it is important to use `undefined` as the second
argument in the alter() function instead of `null`. See
handsontable/handsontable#4458 for the bug tracking ticket at upstream
2017-08-10 15:17:45 +02:00
7892d12ace fix: remove unneeded code
What was the purpose of this in the first place?
2017-08-10 15:04:26 +02:00
747e3c9cd5 feat(editor): implement moving merged cells
Now we recalculate the merged Cells from the meta array after every move
and update the settings with these new values, even if potentially
nothing changed.

While this may cause an (insignificant) performance hit, it is much
simpler code than any alternative of figuring out if merges were affected
and how they changed by a move.
2017-08-04 17:21:45 +02:00
48284a4c9a Prevent moving rows/cols into merges
It is an undocumented feature of the beforeColMove Callback, that
returning false prevents the move.

ToDo
----
* Maybe we want to show a message informing the user that moving
cols/rows into merges is not allowed
2017-08-04 15:56:18 +02:00
8eecc84ae9 Fix merges breaking by creating/removing/moving rows/cols
What still needs to be done:

* handle moving of rows/columns that contain merges
2017-08-03 17:49:54 +02:00
f0eac0110f Adjust for changed beforeRowMove definition
The definition for the callback function for `beforeRowMove` and
`beforeColumnMove` has changed to allow for the simultaneous move of
multiple rows/columns
2017-08-03 15:20:03 +02:00
f7fb4e147d Move handsontable script to lib folder to improve linting
We want to lint our own js code, not the one we use from handsontable.
2017-08-03 12:20:42 +02:00
20ccb0b7bb Use 0.34.0 of handsontable as basis for update
The .js file was created with hot-builder.

The following plugins were included/excluded:

  AutoColumnSize [included]
  AutoRowSize [included]
  Autofill [included]
  ColumnSorting [excluded]
  Comments [excluded]
  ContextMenu [included]
  CopyPaste [included]
  CustomBorders [excluded]
  DragToScroll [included]
  ManualColumnFreeze [included]
   └── Included dependency: ManualColumnMove
  ManualColumnMove [included]
  ManualColumnResize [included]
  ManualRowMove [included]
  ManualRowResize [included]
  MergeCells [included]
  MultipleSelectionHandles [included]
  ObserveChanges [excluded]
  PersistentState [excluded]
  Search [included]
  TouchScroll [excluded]
  UndoRedo [excluded]

We also only use the handsontable.css to excluded styles for the
unused pickaday datepicker. This should also prevent the problem from
issue #131.
The handsontable.css has also be created in the above mentioned process
and misses the styles for the excluded comment plugin
2017-08-02 19:49:11 +02:00
6855000355 Fix linkwizard
This makes the link-wizard usable again.

It changes the handsontable.full.js, since this seems to be the only way
to get the full functionality of the link-wizard. (As suggested by
@lisps)
However the trade-of is, that we may have to redo this when we update
handsontable.
An alternative approach which does not change handsontable.full.js, but
aborts the cell-edit-session is implemented in
12251b3e6cb62bdb1b8f4ccb43169c6cfaf7eae7

WIKI-156, fixes #32
2017-06-08 11:05:13 +02:00
a6ea3b0a3d feat: Add config for default column width
Currently the default width of a cell is wide enough to support its
entire content. Add the config option to specify a default width for all
columns. This may make sense since for cells with very wide content the
cell may become wider than the screen.

ABY-67
2016-11-04 11:13:20 +01:00
cc0e76058f Change rerendering event to MouseOver
This is a workaround to rerender the table. It serves two functions:
1: On wide tables with linebreaks in columns with no pre-defined table widths
(via the tablelayout plugin) reset the width of the table columns to what is
needed by its no narrower content
2: On table with some rows fixed at the top, ensure that the content of these
rows stays at the top as well, not only the lefthand rownumbers

Attaching this to the event 'afterRenderer' did not have the desired results,
as it seemed not to work for usecase 1 at all and for usecase 2 only with a
delay.
2016-10-04 11:14:29 +02:00
8f0b818346 Add plugin infrastructure
This replaces the code specific to the tablelayout plugin. That code has
been moved to said plugin.
2016-09-29 16:41:02 +02:00
8523a49605 Use automatic width calculation for free columns
Free as in - has no pre-defined width
When setting colWidths instead of manualColumnResize then the
auto-resizing would break. This affected both columns without a
predefined width and the resizing by double-click.
2016-09-28 15:43:18 +02:00
9e2ba03587 Correctly set col widths when adding a new column
Again we force a preview to rerender the table

APL-20
2016-09-28 15:14:01 +02:00
1d30a5a117 Set tablewidths correctly if some or all are null 2016-09-28 14:54:08 +02:00
033d198ac8 Adjust column widths after deleting a column
For this purpose we force a preview to cleanly rerender the table.

APL-20
2016-09-28 14:53:59 +02:00
cb73283603 Use default JSON-support 2016-09-27 15:43:27 +02:00
20a8a58e73 Add linting with jshint and fix remaining issues 2016-09-27 14:45:27 +02:00
5cbf537a9a Wrap scripts into proper modules 2016-09-27 14:42:55 +02:00
beafdeb83b Consolidate tablelayout code in one place
APL-20
2016-09-27 13:54:35 +02:00
61a5cce349 Remove unused parameters 2016-09-27 13:33:08 +02:00
b6d9354e21 Use dotnotation when possible 2016-09-27 13:28:10 +02:00
cba708f31e Always use curly brackets 2016-09-27 13:20:55 +02:00
7a58f5ea9c Do not use pre- and post-increment operators
They are error prone, because the difference between ++i and i++ is too
subtle.
2016-09-27 13:15:20 +02:00
a52e5e4577 Create empty tablelayout if plugin active
So we can save column-widths if they are modified

APL-20
2016-09-22 13:05:26 +02:00
a325331077 Update column width on change to be saved
APL-20
2016-09-21 15:39:55 +02:00
30da2a32d4 Only create tablelayout field if plugin is active 2016-09-21 15:39:25 +02:00
41be0d0464 Apply column-widths from tablelayout plugin
APL-20, #111
2016-09-21 14:47:09 +02:00
a1eb31421e Rename cellArray to stop prevent js-conflicts 2015-08-27 10:41:22 +02:00
0471da7da8 Rename global functions to prevent plugin-conflicts 2015-08-27 10:37:13 +02:00
3b11a0ec8d $ is not valid JS in dokuwiki 2015-08-26 11:22:17 +02:00
b5e3949e87 Merge branch 'master' of https://github.com/zen-kizu/edittable into zen-kizu-master 2015-08-18 11:40:06 +02:00
5b5d8a2260 Fix broken toolbar 2015-08-18 11:22:19 +02:00
ecf662d25b Update handsontable to create now columns with autofill 2015-08-17 16:39:09 +02:00
78ff256392 Translation adjustment 2015-08-17 14:44:59 +02:00
05b6b29b87 Split a merge when its top-left cell is removed 2015-08-17 12:16:03 +02:00