summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2017-05-11 14:36:27 +0300
committerGitHub <noreply@github.com>2017-05-11 14:36:27 +0300
commitf72ac12fd257e218c370a4d686be4cc99c2a22d6 (patch)
treedf7937c1835dcd6517717332147cae383a27c05c /shared
parente2e3058a497f43f34f2fcfadf6b63de9211be659 (diff)
downloadvaadin-framework-f72ac12fd257e218c370a4d686be4cc99c2a22d6.tar.gz
vaadin-framework-f72ac12fd257e218c370a4d686be4cc99c2a22d6.zip
Add mobile html5 dnd support using polyfill (#9282)
First step of mobile DND support. - Add mobile html5 dnd support using polyfill - Adds a switch for enabling mobile html5 dnd support - Adds polyfill only when needed - Ignore native Android Chrome drag start because doesn't work properly (no dragend event fired) - Add documentation on enabling mobile HTML5 DnD support - Add mention of drag-drop-polyfill license - Fixed issue in polyfill when not using "snapback" - Add mention of forked polyfill Fixes #9174
Diffstat (limited to 'shared')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ApplicationConstants.java9
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/ui/PageClientRpc.java13
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java5
3 files changed, 26 insertions, 1 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ApplicationConstants.java b/shared/src/main/java/com/vaadin/shared/ApplicationConstants.java
index bb6ec330f7..b3490a434c 100644
--- a/shared/src/main/java/com/vaadin/shared/ApplicationConstants.java
+++ b/shared/src/main/java/com/vaadin/shared/ApplicationConstants.java
@@ -150,7 +150,7 @@ public class ApplicationConstants implements Serializable {
/**
* Name of the parameter used to transmit the push connection identifier.
- *
+ *
* @since 8.0.6
*/
public static final String PUSH_ID_PARAMETER = "v-pushId";
@@ -244,4 +244,11 @@ public class ApplicationConstants implements Serializable {
public static final String FRONTEND_URL_ES5_DEFAULT_VALUE = VAADIN_PROTOCOL_PREFIX
+ "frontend/es5/";
+ /**
+ * Name of the HTML5 DnD Polyfill JavaScript file.
+ *
+ * @since 8.1
+ */
+ public static final String MOBILE_DND_POLYFILL_JS = "drag-drop-polyfill.min.js";
+
}
diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/PageClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/ui/PageClientRpc.java
index acbc41b2c8..15419831e5 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/ui/PageClientRpc.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/ui/PageClientRpc.java
@@ -18,8 +18,21 @@ package com.vaadin.shared.ui.ui;
import com.vaadin.shared.communication.ClientRpc;
+/**
+ * Client side rpc class for Page / UI.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0
+ */
public interface PageClientRpc extends ClientRpc {
+ /**
+ * Reloads the page.
+ */
public void reload();
+ /**
+ * Initialize Mobile HTML5 Drag and Drop Polyfill.
+ */
+ public void initializeMobileHtml5DndPolyfill();
}
diff --git a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java
index c2c7b5c27a..b1d6be2def 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java
@@ -86,6 +86,11 @@ public class UIState extends AbstractSingleComponentContainerState {
tabIndex = 1;
}
+ /**
+ * Enable Mobile HTML5 DnD support.
+ */
+ public boolean enableMobileHTML5DnD = false;
+
public static class LoadingIndicatorConfigurationState
implements Serializable {
public int firstDelay = 300;