Explorar el Código

fix: 导览点击item不停止

xzw hace 3 años
padre
commit
f836e6f713
Se han modificado 1 ficheros con 52 adiciones y 18 borrados
  1. 52 18
      public/static/js/main_2020_show.js

+ 52 - 18
public/static/js/main_2020_show.js

@@ -5493,7 +5493,7 @@ window.Modernizr = function(n, e, t) {
                 return destination && destination.panoId == e
             }
             ,
-            n.prototype.redirectToItem = function(e, t) {
+            n.prototype.redirectToItem = function(e, t, o={}) {///
                 if (null === e || void 0 === e)
                     return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
                 if (!this.wouldInterrupt())
@@ -5505,11 +5505,12 @@ window.Modernizr = function(n, e, t) {
                     s.setTimeout(function() {
                         this.setDestinationItem(e),
                         this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
+                        o.callback && o.callback()//add
                     }
                     .bind(this), 0)
                 }
                 .bind(this);
-                this.interrupt(g.END, 0),
+                if(!o.dontInterrupt)    this.interrupt(g.END, 0) ////add dontInterrupt
                 this.updateSuccessFunction(i)
             }
             ,
@@ -5733,20 +5734,53 @@ window.Modernizr = function(n, e, t) {
             }
             ,
             n.prototype.goToHighlight = function(e) {
-                if (this.wouldInterrupt())
-                    this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
-                else {
-                    if (A.debug("<tour.goto " + e + ">"),
-                    this.isInterrupted())
-                        return;
-                    this.clearWalkingSectionPaused(),
-                    this.setDestinationItem(e),
-                    this.useSpecialTransition("Hilight")
-                    this.goToDestination(true),//add true
-                    h.trackAlways("reach_highlight", {
-                        reach_source: "thumb"
-                    })
-                }
+                /*if (this.wouldInterrupt()){
+                        this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
+                         
+                    }else {
+                        if (A.debug("<tour.goto " + e + ">"),
+                            this.isInterrupted())
+                            return;
+                        this.clearWalkingSectionPaused(),
+                            this.setDestinationItem(e),
+                            this.useSpecialTransition("Hilight")
+                        this.goToDestination(true),//add true
+                            h.trackAlways("reach_highlight", {
+                                reach_source: "thumb"
+                            }) 
+                    }
+                    
+                     setTimeout(()=>{
+                        this.playTour() 
+                    },1800)//自动开始 */
+                     
+                    
+                    if (this.wouldInterrupt()){//在播放的话,改为不Interrupt
+                        
+                        if(this.itemCompare(this.destinationItem, e, 'equal') ){
+                            //目标点与点击的相同,不做处理
+                            console.log('目标点与点击的相同,不做处理')
+                        }else{
+                            this.redirectToItem(e, "goToHighlight", {callback:()=>{
+                                this.tourIsPlaying = !0 
+                            }});
+                            
+                            console.log('redirectToItem')
+                        }
+                    }else{
+                        //没在播放
+                        if ( this.isInterrupted()){ //??
+                            console.log('this.isInterrupted()')
+                            return;
+                        }
+                            
+                        this.clearWalkingSectionPaused(),
+                            this.setDestinationItem(e),
+                            this.useSpecialTransition("Hilight")
+                        this.goToDestination(true) //add true
+                         
+                    }
+                    
             }
             ,
             n.prototype.prevHighlight = function() {
@@ -9698,10 +9732,10 @@ window.Modernizr = function(n, e, t) {
                 w.addEventListener(e, u.bind(this, !0), !0),
                 E.addEventListener(e, o, !0) 
                                
-                S.forEach(function(t) {//会触发导览停止  
+                /* S.forEach(function(t) {//会触发导览停止  
                     t.addEventListener(e, a, !0)
                 }) 
-                $("#drawer img").on(e, a)
+                $("#drawer img").on(e, a) */
             }) 
             document.addEventListener("keydown", u.bind(this, !1), !0)