aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJuho Nurminen <juho@vaadin.com>2014-02-21 15:19:47 +0200
committerArtur Signell <artur@vaadin.com>2014-03-28 18:01:22 +0000
commit95e0e76e3868818471201a67ae2fde404fdb2d9b (patch)
tree5b8b028b0a55c6ed14a066e9a0c8a9af5c7c9f07 /client
parent6a06c3a04c9d2a7408d3b69f4863096425e90e3c (diff)
downloadvaadin-framework-95e0e76e3868818471201a67ae2fde404fdb2d9b.tar.gz
vaadin-framework-95e0e76e3868818471201a67ae2fde404fdb2d9b.zip
Added a window.prompt polyfill for Metro IE (#13367)
Makes metro versions of IE suggest switching to the desktop when window.prompt is called Change-Id: If794631b0fa633aac3572f241374ea8883671c85
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ApplicationConfiguration.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ApplicationConfiguration.java b/client/src/com/vaadin/client/ApplicationConfiguration.java
index 1a5b0d836f..8023c8e50a 100644
--- a/client/src/com/vaadin/client/ApplicationConfiguration.java
+++ b/client/src/com/vaadin/client/ApplicationConfiguration.java
@@ -605,6 +605,11 @@ public class ApplicationConfiguration implements EntryPoint {
enableIOS6castFix();
}
+ // Enable IE prompt fix (#13367)
+ if (browserInfo.isIE() && browserInfo.getBrowserMajorVersion() >= 10) {
+ enableIEPromptFix();
+ }
+
// Prepare the debugging window
if (isDebugMode()) {
/*
@@ -682,6 +687,25 @@ public class ApplicationConfiguration implements EntryPoint {
}-*/;
/**
+ * Make Metro versions of IE suggest switching to the desktop when
+ * window.prompt is called.
+ */
+ private static native void enableIEPromptFix()
+ /*-{
+ var prompt = $wnd.prompt;
+ $wnd.prompt = function () {
+ var result = prompt.apply($wnd, Array.prototype.slice.call(arguments));
+ if (result === undefined) {
+ // force the browser to suggest desktop mode
+ showModalDialog();
+ return null;
+ } else {
+ return result;
+ }
+ };
+ }-*/;
+
+ /**
* Registers that callback that the bootstrap javascript uses to start
* applications once the widgetset is loaded and all required information is
* available