Browse Source

closing production page, also close the agenda and reload the prod home

Bachir Soussi Chiadmi 6 years ago
parent
commit
c0837f799e

File diff suppressed because it is too large
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js


File diff suppressed because it is too large
+ 0 - 13
sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css


+ 16 - 7
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -428,8 +428,13 @@
       if(theme != ''){
         _$body.trigger({'type':theme+'-col-closed'});
       }
-      // remove the col
-      $col.remove();
+      if(_$body.is('.entity-type-node.bundle-page')){
+        // remove all the col (prod page and agenda in case)
+        $col.add($col.siblings('.col')).remove();
+      }else{
+        // remove the col
+        $col.remove();
+      }
       checkRowEmpty();
       checkVisibleCorpusMapSpace();
     };
@@ -1039,8 +1044,8 @@
       },
       onEnded(){
         console.log('AudioPlayer onEnded()');
-        this.emmit('audio-ended');
         this.stop();
+        this.emmit('audio-ended');
       },
       // cartel functions
       loadNode(nid){
@@ -1121,15 +1126,15 @@
         return this;
       },
       emmit(event_name, args){
-        // console.log('AudioPlayer emmit() event_name', event_name);
-        // console.log('AudioPlayer emmit() handlers', this.event_handlers[event_name]);
+        console.log('AudioPlayer emmit() event_name', event_name);
+        console.log('AudioPlayer emmit() handlers', this.event_handlers[event_name]);
         var handler;
         var args  = args || {};
         for (var i = this.event_handlers[event_name].length-1; i >= 0 ; i--) {
           handler = this.event_handlers[event_name][i];
           // console.log('AudioPlayer emmit() loop handler', handler);
           setTimeout(function(){
-            // console.log('AudioPlayer emmit() timeout handler', handler);
+            console.log('AudioPlayer emmit() timeout handler', handler);
             handler(args);
           }, 0);
         }
@@ -1216,6 +1221,7 @@
         }
       },
       next(){
+        console.log('RandomPlayer next', this.active, this.shuffledPlaylist.length);
         if(this.active && this.shuffledPlaylist.length > 0)
           _audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0]);
       },
@@ -1224,7 +1230,7 @@
         this.next();
       },
       onAudioPlayerEnded(){
-        //console.log('RandomPlayer : onAudioPlayerEnded()');
+        console.log('RandomPlayer : onAudioPlayerEnded()');
         this.next();
       }
     };
@@ -1620,6 +1626,9 @@
           }else{
             // if we were on production page just scramble collection in case of map was filtered
             _$corpus_canvas.trigger({'type':'scramble-collection'});
+            // reload production home
+            $('a[data-drupal-link-system-path="productions"]', '#block-mainnavigation')
+              .removeClass('is-active').trigger('click');
           }
         }else{
           // remove is-active class from index or notice entree links

Some files were not shown because too many files changed in this diff