fit-ui 2.11.14 → 2.11.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Fit.UI.js +13 -15
- package/dist/Fit.UI.min.js +1 -1
- package/package.json +1 -1
package/dist/Fit.UI.js
CHANGED
|
@@ -682,7 +682,7 @@ Fit._internal =
|
|
|
682
682
|
{
|
|
683
683
|
Core:
|
|
684
684
|
{
|
|
685
|
-
VersionInfo: { Major: 2, Minor: 11, Patch:
|
|
685
|
+
VersionInfo: { Major: 2, Minor: 11, Patch: 16 } // Do NOT modify format - version numbers are programmatically changed when releasing new versions - MUST be on a separate line!
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
688
|
|
|
@@ -5833,6 +5833,8 @@ Fit.Device =
|
|
|
5833
5833
|
// maxTouchPoints Chrome 35+ IE 11+ Safari 13+ https://developer.mozilla.org/en-US/docs/Web/API/Navigator/maxTouchPoints
|
|
5834
5834
|
// Pointer media queries Chrome 41+ Edge12 Safari 9+ https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer
|
|
5835
5835
|
|
|
5836
|
+
var pointerQueriesSupported = window.matchMedia && (window.matchMedia("(any-pointer:coarse)").matches === true || window.matchMedia("(any-pointer:fine)").matches === true);
|
|
5837
|
+
|
|
5836
5838
|
// Older touch enabled browsers such as IE11 running on early hybrid devices like Surface tablets, will not have
|
|
5837
5839
|
// OptimizeForTouch become true because IE11 does not support pointer media queries (e.g. pointer:fine). Furthermore such
|
|
5838
5840
|
// devices detached from mouse and keyboard (tablet mode) will not have HasMouse become false, also due to the lack of pointer
|
|
@@ -5841,12 +5843,6 @@ Fit.Device =
|
|
|
5841
5843
|
// the desired experience, which must ensure that the Fit.Device flags are set appropriately after Fit.UI has loaded, but before
|
|
5842
5844
|
// any widgets or controls are created.
|
|
5843
5845
|
|
|
5844
|
-
// Detect lack of high precision pointer device (mouse)
|
|
5845
|
-
if (window.matchMedia && matchMedia("(pointer:fine)").matches === false) // Will not detect e.g. IE11 in "tablet mode" - see comment above
|
|
5846
|
-
{
|
|
5847
|
-
Fit.Device.HasMouse = false;
|
|
5848
|
-
}
|
|
5849
|
-
|
|
5850
5846
|
// Detect touch support using fairly new maxTouchPoints property (Safari 13+) if possible. If not, then try alternatives.
|
|
5851
5847
|
// Some browsers on modern devices with support for both touch and mouse returns false for ("ontouchstart" in window),
|
|
5852
5848
|
// since it historically has been used to detect "touch only" devices. Therefore we also check against ("TouchEvent" in window).
|
|
@@ -5857,16 +5853,18 @@ Fit.Device =
|
|
|
5857
5853
|
Fit.Device.HasTouch = true;
|
|
5858
5854
|
}
|
|
5859
5855
|
|
|
5860
|
-
//
|
|
5861
|
-
//
|
|
5862
|
-
|
|
5856
|
+
// Detect lack of high precision pointer device (mouse).
|
|
5857
|
+
// If pointer queries are not supported, then assume a mouse is not present if touch capabilities are detected, which
|
|
5858
|
+
// will be the case on old touch devices (e.g. Safari v. 8 and below on iOS or Chrome v. 40 and below on Android).
|
|
5859
|
+
if ((pointerQueriesSupported === true && matchMedia("(any-pointer:fine)").matches === false) ||
|
|
5860
|
+
(pointerQueriesSupported === false && Fit.Device.HasTouch === true))
|
|
5863
5861
|
{
|
|
5864
|
-
Fit.Device.
|
|
5862
|
+
Fit.Device.HasMouse = false;
|
|
5865
5863
|
}
|
|
5866
|
-
|
|
5867
|
-
//
|
|
5868
|
-
|
|
5869
|
-
|
|
5864
|
+
|
|
5865
|
+
// Determine whether user experience should be optimized for touch
|
|
5866
|
+
if ((pointerQueriesSupported === true && matchMedia("(pointer:coarse)").matches === true) || // Optimize for touch if this is the primary pointing device
|
|
5867
|
+
(pointerQueriesSupported === false && Fit.Device.HasTouch === true && Fit.Device.HasMouse === false)) // Optimize for touch if this is supported and no mouse is detected
|
|
5870
5868
|
{
|
|
5871
5869
|
Fit.Device.OptimizeForTouch = true;
|
|
5872
5870
|
}
|