Преглед на файлове

articles filter now center the nodes (instead of fading others)

Bachir Soussi Chiadmi преди 5 години
родител
ревизия
03ab172f42

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js


+ 24 - 4
sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js

@@ -932,9 +932,23 @@
     function activateArticlesFilter(){
       //console.log('activateArticlesFilter');
       _articles_filter_on = true;
+      // OPTION 1 : just fade no article nodes
+      // for (var i = 0; i < _no_articles_nodes.length; i++) {
+      //   _no_articles_nodes[i].fade();
+      // }
+
+      // OPTION 2 : center the articles nodes and aside others
+      closeAllEntries();
+      _nodes_centered = [];
+      for (var i = 0; i < _articles_nodes.length; i++) {
+        _articles_nodes[i].setCentered();
+        // record centered nodes for inter node repulsions
+        _nodes_centered.push(_articles_nodes[i]);
+      }
       for (var i = 0; i < _no_articles_nodes.length; i++) {
-        _no_articles_nodes[i].fade();
+        _no_articles_nodes[i].setAside();
       }
+
       updateRandomPlaylist(_articles_nodes);
       if(typeof _paq !== 'undefined'){
         // trackEvent(category, action, [name], [value])
@@ -944,9 +958,15 @@
     function deactivateArticlesFilter(){
       //console.log('deactivateArticlesFilter');
       _articles_filter_on = false;
-      for (var i = 0; i < _no_articles_nodes.length; i++) {
-        _no_articles_nodes[i].unFade();
-      }
+
+      // OPTION 1 : just fade no article nodes
+      // for (var i = 0; i < _no_articles_nodes.length; i++) {
+      //   _no_articles_nodes[i].unFade();
+      // }
+
+      // OPTION 2 : centered / aside
+      scrambleCollection();
+
       updateRandomPlaylist(_playlist);
       if(typeof _paq !== 'undefined'){
         // trackEvent(category, action, [name], [value])

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js


+ 5 - 1
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -680,6 +680,7 @@
       e.preventDefault();
       var $link = $(this);
 
+      // let the site-name link going through as it will shuffle the map if already active
       if($link.is('.is-active') && !$link.is('.site-name'))
         return false;
 
@@ -1858,7 +1859,10 @@
         if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){
           if(!_$body.is('.entity-type-node.bundle-page')){
             // we weren't on production or entree, so go back to front page
-            backToFrontPage();
+            if(!$('a.articles-link').is('.is-active')){
+              // don't go back to front page if articles filter is on
+              backToFrontPage();
+            }
           }else{
             // if we were on production page just scramble collection in case of map was filtered
             _$corpus_canvas.trigger({'type':'scramble-collection'});

Някои файлове не бяха показани, защото твърде много файлове са промени