aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/utils
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-27 14:21:19 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-27 14:21:19 +0100
commit8163f730f4b195160b5b9ca4202c1f304ac68b27 (patch)
tree8ec4fc4c2159a133ee2320dba21b10df2102be70 /src/main/kotlin/pl/treksoft/kvision/utils
parent1dbc0ccd0f1a8b0b5afc99457af0a34a4d4b1b6b (diff)
downloadkvision-8163f730f4b195160b5b9ca4202c1f304ac68b27.tar.gz
kvision-8163f730f4b195160b5b9ca4202c1f304ac68b27.tar.bz2
kvision-8163f730f4b195160b5b9ca4202c1f304ac68b27.zip
Internet Explorer and Edge compatibility fixes.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
index 335e0415..a25d8e06 100644
--- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt
@@ -26,6 +26,7 @@ package pl.treksoft.kvision.utils
import pl.treksoft.kvision.KVManager
import pl.treksoft.kvision.core.CssSize
import pl.treksoft.kvision.core.UNIT
+import kotlin.browser.window
import kotlin.js.Date
/**
@@ -192,3 +193,9 @@ fun String.toDateF(format: String = "YYYY-MM-DD HH:mm:ss"): Date {
fun Date.toStringF(format: String = "YYYY-MM-DD HH:mm:ss"): String {
return KVManager.fecha.format(this, format)
}
+
+/**
+ * Utility function to detect Internet Explorer 11.
+ * @return true if the current browser is IE11
+ */
+fun isIE11(): Boolean = window.navigator.userAgent.matches("Trident\\/7\\.")