From bb03f9bf7bf3bac6ddf7fb52a8fdce3359874961 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 27 Mar 2018 15:52:50 +0200 Subject: [PATCH] fixed CompoPlayer controls init bug --- .../edlptheme/assets/dist/scripts/main.min.js | 23 ++++++++++--------- .../custom/edlptheme/assets/scripts/main.js | 23 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js index d97417d42..7eef23a27 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -663,17 +663,18 @@ this.$composer = $('.composition_ui .composer'); this.$compo = $('.composition_ui .composer .composition'); this.$controls = $('.composition_ui .composer .compo-player-controls'); - this.$previous = $('
').addClass('previous') - .on('click', this.prev.bind(this)) - .appendTo(this.$controls); - this.$playpause = $('
').addClass('play-pause') - .on('click', this.togglePlayPause.bind(this)) - .appendTo(this.$controls); - this.$next = $('
').addClass('next') - .on('click', this.next.bind(this)) - .appendTo(this.$controls); - // this.$playpause = $('.compo-player-controls', this.$composer) - // .on('click', this.togglePlayPause.bind(this)); + if(!this.$controls.is('.ready')){ + this.$previous = $('
').addClass('previous') + .on('click', this.prev.bind(this)) + .appendTo(this.$controls); + this.$playpause = $('
').addClass('play-pause') + .on('click', this.togglePlayPause.bind(this)) + .appendTo(this.$controls); + this.$next = $('
').addClass('next') + .on('click', this.next.bind(this)) + .appendTo(this.$controls); + this.$controls.addClass('ready'); + } this.refresh(); }, refresh(){ diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js index d97417d42..7eef23a27 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js @@ -663,17 +663,18 @@ this.$composer = $('.composition_ui .composer'); this.$compo = $('.composition_ui .composer .composition'); this.$controls = $('.composition_ui .composer .compo-player-controls'); - this.$previous = $('
').addClass('previous') - .on('click', this.prev.bind(this)) - .appendTo(this.$controls); - this.$playpause = $('
').addClass('play-pause') - .on('click', this.togglePlayPause.bind(this)) - .appendTo(this.$controls); - this.$next = $('
').addClass('next') - .on('click', this.next.bind(this)) - .appendTo(this.$controls); - // this.$playpause = $('.compo-player-controls', this.$composer) - // .on('click', this.togglePlayPause.bind(this)); + if(!this.$controls.is('.ready')){ + this.$previous = $('
').addClass('previous') + .on('click', this.prev.bind(this)) + .appendTo(this.$controls); + this.$playpause = $('
').addClass('play-pause') + .on('click', this.togglePlayPause.bind(this)) + .appendTo(this.$controls); + this.$next = $('
').addClass('next') + .on('click', this.next.bind(this)) + .appendTo(this.$controls); + this.$controls.addClass('ready'); + } this.refresh(); }, refresh(){