fixed cartel autoswitch
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user