Browse Source

fixed CompoPlayer controls init bug

Bachir Soussi Chiadmi 7 years ago
parent
commit
bb03f9bf7b

+ 12 - 11
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 = $('<div>').addClass('previous')
-          .on('click', this.prev.bind(this))
-          .appendTo(this.$controls);
-        this.$playpause = $('<div>').addClass('play-pause')
-          .on('click', this.togglePlayPause.bind(this))
-          .appendTo(this.$controls);
-        this.$next = $('<div>').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 = $('<div>').addClass('previous')
+            .on('click', this.prev.bind(this))
+            .appendTo(this.$controls);
+          this.$playpause = $('<div>').addClass('play-pause')
+            .on('click', this.togglePlayPause.bind(this))
+            .appendTo(this.$controls);
+          this.$next = $('<div>').addClass('next')
+            .on('click', this.next.bind(this))
+            .appendTo(this.$controls);
+          this.$controls.addClass('ready');
+        }
         this.refresh();
       },
       refresh(){

+ 12 - 11
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 = $('<div>').addClass('previous')
-          .on('click', this.prev.bind(this))
-          .appendTo(this.$controls);
-        this.$playpause = $('<div>').addClass('play-pause')
-          .on('click', this.togglePlayPause.bind(this))
-          .appendTo(this.$controls);
-        this.$next = $('<div>').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 = $('<div>').addClass('previous')
+            .on('click', this.prev.bind(this))
+            .appendTo(this.$controls);
+          this.$playpause = $('<div>').addClass('play-pause')
+            .on('click', this.togglePlayPause.bind(this))
+            .appendTo(this.$controls);
+          this.$next = $('<div>').addClass('next')
+            .on('click', this.next.bind(this))
+            .appendTo(this.$controls);
+          this.$controls.addClass('ready');
+        }
         this.refresh();
       },
       refresh(){