Skip to content

Conversation

@adumesny
Copy link
Member

Description

fulling wokring html5 drag&drop is now in main branch... for upcoming 3.0 release!

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

rhlin and others added 29 commits November 15, 2020 08:43
draggable
1. use requireAnimateFrame
2. set up will change
3. use passive event if possible
4. change helper position from 'fixed' to 'absolute' to avoide flicker
5. dragend event binding after dragstart
6. fix removing ui-draggable-dragging class for drag-in element
droppable
1. pre transform accept to function on init

from https://github.com/rhlin/gridstack.js feat-h5dd-optimize
still way too slow for html5 vs mouse event JQ. Will have to roll our own.
* make sure to add .ui-resizable-resizing class while resizing, else we fall into CSS 300ms animation (grid default to animate)
resize is now fast like dragging
* removed drag/resize delay timeout - not needed and Util has routine anyway if we decide later
* fixed typos throughout H5 code
* changed credit order to give credit where credit is due (rhlin)
H5: rebased from 2.2.0 latest code
* went through new code for DD and made sure we have a type for everything
* cleanup to match lib style (public vs private)
* made all routines return 'this' for chainable calls. Abstract DDBaseImplement still return :void
otherwise had to do
`return this as unknown as DDBaseImplement`
for all sub-classes which is annoying.
* created DDUIData to hold what we need for callback data. Commented out part we don't use today...
* changed event handlers to be methods, but init to var bindable which is more typescrip like (and easier to understand IMO)
* this happened to fix issue dragging between 2 grids not moving obj
* dragging items (from second grid) to trash will now actaully remove them
* dragLeave and drop will now share a lot of the callbacks cleanups
h5: you can now drag to trash to delete item
* always thought it was weird to have a (per) grid option when we had a list of D&D
plugins but last one won.
* now we only have a global static DD that is shared. Grid instance can be infered by element
for any needed options.
h5: del `ddPlugin` grid option
* you can now drag from either grids in two.html to the trash to delete.
html5 native D7D only supports sinlge callback, which si fine for all but the drop to erase target,
gridstack now sets a single callback and tell that grid to update.
h5: fixed dragging from multiple grid to trash
* you can now drag in from two.hmtl toolbar icons (2 of them)
* moved Gridstack internal method to Utils.getElements() to get list of matching items
* dd native uses that to iterate over each API like jqueryUI does.
h5: GridStackDDNative now support list of items
* all drag&drop grid code has been moved to gridstack-dd.ts (base class for html5 and jquery version)
* that reduces static grid requirements down from 43k to just 35k
* with html5 complete is still 64k (+29k) and jq 187k (+152k)
h5: moved all DD code to gridstack-dd.ts
* changed the tests to not have any $() jquery anymore and switch them to use the html5 DD instead
* all demos now use html5 version, added two-jq.html for legacy and to compare
* reverted back to karma-typescript 4.1.1 to get correct error line numbers
* gridstack.all.js no longer exist. changed all to gridstack-h5.js and readme
(more changes on how to include later)
* isResizable (new) / isDraggable / isDroppable work on a single element
as it was confusting to e list of items (could be miss-match)
* latest tool lock file
h5: remove jquery from tests, switch to h5 version
@adumesny adumesny merged commit a61acfd into gridstack:develop Nov 23, 2020
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.

2 participants