Преглед на файлове

fixed cartel autoswitch

Bachir Soussi Chiadmi преди 6 години
родител
ревизия
8a854a45ab
променени са 2 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 0 0
      sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js
  2. 10 3
      sites/all/themes/custom/edlptheme/assets/scripts/main.js

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js


+ 10 - 3
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -1166,14 +1166,19 @@
           .fail(this.onNodeLoadFail.bind(this));
       },
       onNodeLoaded(data){
-        // console.log('AudioPlayer node loaded');
+        console.log('AudioPlayer node loaded', data);
         this.$cartel.html(data.rendered).removeClass('loading');
         _$body.trigger({'type':'new-audio-cartel-loaded'});
         initAjaxLinks();
-        // init cartel auto switch
+        // cartel autoswitch
         this.scndCartel_visible = 0;
         this.$cartel.removeClass('second-visible');
-        this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
+        // if second cartel has special info ?
+        if (this.$cartel.find('.second-cartel .col-left').children().length > 1
+            || this.$cartel.find('.second-cartel').children('.col-right').length){
+          // init cartel auto switch
+          this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
+        }
         // call drupal behaviours (for addtoany)
         Drupal.attachBehaviors(this.$cartel);
         // open automaticly tha article if needed
@@ -1228,6 +1233,8 @@
           // return to first cartel
           this.$cartel.removeClass('second-visible');
           this.scndCartel_visible = 0;
+          // kill the auto switch after one rotation
+          this.clearIntervalAutoCartelSwitch();
         }else{
           // switch to 2nd cartel
           this.$cartel.addClass('second-visible');

Някои файлове не бяха показани, защото твърде много файлове са промени