Skip to content

Commit

Permalink
适配了ios的Safair浏览器
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeNightShimu committed May 7, 2024
1 parent c27b1f0 commit 4076376
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dist/mobile-select.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,18 +587,18 @@ var MobileSelect = function () {
switch (t.type) {
case "touchstart":
case "mousedown":
n.style.transition = "none 0s ease-out", this.startY = Math.floor(t instanceof TouchEvent ? t.touches[0].clientY : t.clientY), this.preMoveY = this.startY, t.type === "mousedown" && (this.enableClickStatus = !0);
n.style.transition = "none 0s ease-out", this.startY = ('TouchEvent' in window && t instanceof TouchEvent) ? Math.floor(t.touches[0].clientY) : Math.floor(t.clientY), this.preMoveY = this.startY, t.type === "mousedown" && (this.enableClickStatus = !0);
break;

case "touchmove":
case "mousemove":
if (t.preventDefault(), t.type === "mousemove" && !this.enableClickStatus) break;
this.moveY = Math.floor(t instanceof TouchEvent ? t.touches[0].clientY : t.clientY), this.offsetY = (this.moveY - this.preMoveY) * this.config.scrollSpeed, this.updateCurDistance(n, h), this.curDistance[h] = this.curDistance[h] + this.offsetY, this.movePosition(n, this.curDistance[h]), this.preMoveY = this.moveY;
this.moveY = ('TouchEvent' in window && t instanceof TouchEvent) ? Math.floor(t.touches[0].clientY) : Math.floor(t.clientY), this.offsetY = (this.moveY - this.preMoveY) * this.config.scrollSpeed, this.updateCurDistance(n, h), this.curDistance[h] = this.curDistance[h] + this.offsetY, this.movePosition(n, this.curDistance[h]), this.preMoveY = this.moveY;
break;

case "touchend":
case "mouseup":
if (n.style.transition = "transform 0.18s ease-out", this.moveEndY = Math.floor(t instanceof TouchEvent ? t.changedTouches[0].clientY : t.clientY), this.offsetSum = this.moveEndY - this.startY, this.oversizeBorder = -(n.getElementsByTagName("li").length - 3) * this.optionHeight, this.offsetSum == 0) {
if (n.style.transition = "transform 0.18s ease-out", this.moveEndY = ('TouchEvent' in window && t instanceof TouchEvent) ? Math.floor(t.changedTouches[0].clientY) : Math.floor(t.clientY), this.offsetSum = this.moveEndY - this.startY, this.oversizeBorder = -(n.getElementsByTagName("li").length - 3) * this.optionHeight, this.offsetSum == 0) {
var g = Math.floor((window.innerHeight - this.moveEndY) / 40);

if (g != 2) {
Expand Down Expand Up @@ -663,4 +663,4 @@ var MobileSelect = function () {
triggerDisplayValue: !0,
scrollSpeed: 1
}), o(r, "REQUIRED_PARAMS", ["trigger", "wheels"]), r;
}();
}();

0 comments on commit 4076376

Please sign in to comment.