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