zhouenguang 3 rokov pred
rodič
commit
0c69af6339
1 zmenil súbory, kde vykonal 13 pridanie a 4 odobranie
  1. 13 4
      web/public/static/js/main_2020_show.js

+ 13 - 4
web/public/static/js/main_2020_show.js

@@ -4915,11 +4915,20 @@ window.Modernizr = function(n, e, t) {
                     .bind(this), this.goNext.bind(this))
             }
             ,
-            n.prototype.playTour = function() {
+            n.prototype.playTour = function() 
+            {
                 if (!this.bounceable()) {
 
-                    if(!this.currentItem) this.currentItem = []
-                    if(this.player.model.mode == "panorama" && (this.currentItem[0] != 0 || this.destinationItem[0] != this.nItems-1)){
+                    // 初始为null,从第一个导览点开始
+                    if(!this.currentItem) this.currentItem = [0, 0]
+
+                    if(
+                        this.player.model.mode == "panorama" && 
+                        (
+                            this.currentItem[0] != 0 || 
+                            this.destinationItem && this.destinationItem[0] != this.nItems-1
+                        )
+                    ){
                         // 周恩光加 从当前pano进行自动导览
                         let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
                         // this.model.heroLocations.forEach( (value, index) => {
@@ -5107,7 +5116,7 @@ window.Modernizr = function(n, e, t) {
             ,
             n.prototype.prevItem = function(currentItem) {
                 //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
-                if(currentItem == void 0)return this.firstDestination()
+                if(currentItem == void 0) return this.firstDestination()
                 var item;
                 var lastLocation = this.model.heroLocations[currentItem[0]-1];
                 if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0