You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Use the dnd-draggable directive to make your element draggable
56
56
*`dndDraggingSource` This class will be added to the element after the drag operation was started, meaning it only affects the original element that is still at it's source position, and not the "element" that the user is dragging with his mouse pointer
57
57
58
58
### dnd-list directive
59
-
Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single li element as child with the ng-repeat directive. If you don't do that, we will not be able to position the dropped element correctly. If you want your list to be sortable, also add the dnd-draggable directive to your li element(s). Both the dnd-list and it's direct children must have position: relative CSS style, otherwise the positioning algorithm will not be able to determine the correct placeholder position in all browsers. If you use nested dnd-lists, make sure that all elements excecpt for the dnd-lists and it's direct children have the pointer-events: none CSS style.
59
+
Use the dnd-list attribute to make your list element a dropzone. Usually you will add a single li element as child with the ng-repeat directive. If you don't do that, we will not be able to position the dropped element correctly. If you want your list to be sortable, also add the dnd-draggable directive to your li element(s). Both the dnd-list and it's direct children must have position: relative CSS style, otherwise the positioning algorithm will not be able to determine the correct placeholder position in all browsers.
60
60
61
61
**Attributes**
62
62
*`dnd-list` Required attribute. The value has to be the array in which the data of the dropped element should be inserted.
@@ -68,20 +68,16 @@ Use the dnd-list attribute to make your list element a dropzone. Usually you wil
68
68
*`dndDragover` This class will be added to the list while an element is being dragged over the list.
69
69
70
70
### Required CSS styles
71
-
*`pointer-events: none` With nested lists it's very important that **only the dnd-list and it's children** react to mouse events.
72
-
*`position: relative` Both the dnd-list and it's children require this, so that the directive can determine the mouse position relative to the list and thus calculate the correct drop position.
71
+
Both the dnd-list and it's children require relative positioning, so that the directive can determine the mouse position relative to the list and thus calculate the correct drop position.
73
72
74
73
<pre>
75
-
ul[dnd-list] * {
76
-
pointer-events: none;
77
-
}
78
-
79
74
ul[dnd-list], ul[dnd-list] > li {
80
-
pointer-events: auto;
81
75
position: relative;
82
76
}
83
77
</pre>
84
78
79
+
*Since 1.2.0 `pointer-events: none` is no longer required*
80
+
85
81
### Example
86
82
87
83
Take a look at the code in the [Simple Lists](http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple) example
0 commit comments