summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Wagner <wbadam@users.noreply.github.com>2017-05-03 12:08:38 +0300
committerPekka Hyvönen <pekka@vaadin.com>2017-05-03 12:08:37 +0300
commit9a0598b3f90d9d8bd4fd7fc017d1689d5822c39e (patch)
tree8a40eeea4fcd467ab7a6b0cce9b981077cb599d6
parentac00b616f4522b69dfcaf324be16b1880470392b (diff)
downloadvaadin-framework-9a0598b3f90d9d8bd4fd7fc017d1689d5822c39e.tar.gz
vaadin-framework-9a0598b3f90d9d8bd4fd7fc017d1689d5822c39e.zip
Mention the applied CSS styles in the documentation (#9219)
-rw-r--r--documentation/advanced/advanced-dragndrop.asciidoc20
1 files changed, 19 insertions, 1 deletions
diff --git a/documentation/advanced/advanced-dragndrop.asciidoc b/documentation/advanced/advanced-dragndrop.asciidoc
index 8516e9be6f..804224d317 100644
--- a/documentation/advanced/advanced-dragndrop.asciidoc
+++ b/documentation/advanced/advanced-dragndrop.asciidoc
@@ -82,6 +82,11 @@ user-select: none;
----
====
+=== CSS Style Rules
+
+The drag source element, additional to it's primary style name, have a style name with the `-dragsource` suffix. For example, a Label component would have the style name `v-label-dragsource` when the drag source extension is applied to it.
+Additionally, the elements also have the `v-draggable` style name that is independent of the component's primary style.
+
[[advanced.dragndrop.drophandler]]
== Drop Target
@@ -129,11 +134,15 @@ The __drag over criteria__ allows you determine whether the current drag source
The __drop criteria__ is similar to __drag over criteria__, but it is executed when the user has dropped the data by releasing the mouse button. The script gets the `drop` event as a parameter named `event`. Returning `false` will prevent the drop and no drop event is fired on the server side.
+=== CSS Style Rules
+
+When dragging data over a drop target and the drag over criteria passes, a style name is applied to indicate that the element accepts drops. This style name is the primary style name with `-drag-center` suffix, e.g. `v-label-drag-center`.
+
////
TODO Add an example of drag over criteria and drop criteria
////
-===
+===
////
TODO add back when supported with new API ?
@@ -222,6 +231,10 @@ dragSource.addGridDragEndListener(event -> {
The dragged rows can be accessed from both events using the `getDraggedItems()` method.
+==== CSS Style Rules
+
+A drag source Grid's rows have the `v-grid-row-dragsource` and the `v-draggable` style names applied to indicate that the rows are draggable.
+
=== Grid as a Drop Target
To make a Grid component's rows accept a drop event, apply the [classname]#GridDropTarget# extension to the component. When creating the extension, you need to specify where the transferred data can be dropped on.
@@ -264,6 +277,11 @@ dropTarget.addGridDropListener(event -> {
});
----
+==== CSS Style Rules
+
+When dragging data over a drop target Grid's row, depending on the drop mode and the mouse position relative to the row, a style name is applied to the row to indicate the drop location.
+`v-grid-row-drag-center` indicates ON_TOP, `v-grid-row-drag-top` indicates ABOVE and `v-grid-row-drag-bottom` indicates BELOW locations.
+
(((range="endofrange", startref="term.advanced.dragndrop")))