From 2ca1ff5f0ea0354e973c968f5be155ed7b845e43 Mon Sep 17 00:00:00 2001 From: owen-m1 Date: Mon, 10 Jun 2019 20:14:36 -0400 Subject: [PATCH] Better IE compatibility --- src/BrowserInfo.js | 2 +- src/Sortable.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BrowserInfo.js b/src/BrowserInfo.js index b74847456..7742ae17d 100644 --- a/src/BrowserInfo.js +++ b/src/BrowserInfo.js @@ -2,7 +2,7 @@ function userAgent(pattern) { return !!navigator.userAgent.match(pattern); } -const IE11OrLess = /*@__PURE__*/userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile)/i); +const IE11OrLess = /*@__PURE__*/userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i); const Edge = /*@__PURE__*/userAgent(/Edge/i); const FireFox = /*@__PURE__*/userAgent(/firefox/i); const Safari = /*@__PURE__*/userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i); diff --git a/src/Sortable.js b/src/Sortable.js index f7e3e1080..723350b53 100644 --- a/src/Sortable.js +++ b/src/Sortable.js @@ -377,7 +377,7 @@ function Sortable(el, options) { dataIdAttr: 'data-id', delay: 0, delayOnTouchOnly: false, - touchStartThreshold: Number.parseInt(window.devicePixelRatio, 10) || 1, + touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, forceFallback: false, fallbackClass: 'sortable-fallback', fallbackOnBody: false, @@ -666,7 +666,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { }, _triggerDragStart: function (/** Event */evt, /** Touch */touch) { - touch = touch || (evt.pointerType == 'touch' ? evt : null); + touch = touch || (evt.pointerType == 'touch' && evt); if (!this.nativeDraggable || touch) { if (this.options.supportPointer) {