Browse Source

improved node popup placement with corpus evolution_zone, fix #540

Bachir Soussi Chiadmi 4 years ago
parent
commit
4433431b9c

File diff suppressed because it is too large
+ 0 - 0
web/modules/custom/edlp_corpus/assets/dist/scripts/corpus.min.js


+ 26 - 4
web/modules/custom/edlp_corpus/assets/scripts/corpus.js

@@ -755,9 +755,18 @@
     function moveEvolutionZone(l, r){
       var left = l || 0;
       var right = r || 0;
-      _evolution_zone.left = Math.max(_scene_props.width/5, left+20);
-      _evolution_zone.right = Math.min(_scene_props.width - _scene_props.width/5, _scene_props.width-right+20);
+      console.log("moveEvolutionZone",left,right);
+      console.log("_scene_props", _scene_props);
+      _evolution_zone.left =
+        left == 0
+        ? left+20 
+        : Math.max(_scene_props.width/5, left+20);
+      _evolution_zone.right =
+        right == 0
+        ? _scene_props.width-right+20
+        : Math.min(_scene_props.width - _scene_props.width/5, _scene_props.width-right+20);
       _evolution_zone.center = _evolution_zone.left + (_evolution_zone.right - _evolution_zone.left)/2;
+      console.log("moveEvolutionZone",_evolution_zone);
       // move _attracter to the center of the zone
       resizePhysics();
     }
@@ -1185,11 +1194,24 @@
         };
 
         NodePopUp.prototype.setPositioning = function(){
+          // switch(true){
+          //   case this.node.x > this.node.wall_limits.right-350-_evolution_zone.right && this.node.y < this.node.wall_limits.top+200:
+          //     this.$dom.attr('pos', 'bottom-left');
+          //     break;
+          //   case this.node.x > this.node.wall_limits.right-350-_evolution_zone.right:
+          //     this.$dom.attr('pos', 'top-left');
+          //     break;
+          //   case this.node.y < this.node.wall_limits.top+200:
+          //     this.$dom.attr('pos', 'bottom-right');
+          //     break;
+          //   default:
+          //     this.$dom.attr('pos', 'top-right');
+          // }
           switch(true){
-            case this.node.x > this.node.wall_limits.right-350 && this.node.y < this.node.wall_limits.top+200:
+            case this.node.x > _evolution_zone.right-350 && this.node.y < this.node.wall_limits.top+200:
               this.$dom.attr('pos', 'bottom-left');
               break;
-            case this.node.x > this.node.wall_limits.right-350:
+            case this.node.x > _evolution_zone.right-350:
               this.$dom.attr('pos', 'top-left');
               break;
             case this.node.y < this.node.wall_limits.top+200:

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


+ 3 - 6
web/themes/custom/edlptheme/assets/scripts/main.js

@@ -71,7 +71,6 @@
         .on('submit', onSubmitLogForm)
         .addClass('ajax-enabled');
     };
-
     function onSubmitLogForm(e){
       e.preventDefault();
       // console.log('onSubmitLogForm', e);
@@ -83,7 +82,6 @@
       logIn(args).then(getStudioLinkBlock);
       return false;
     };
-
     function logIn(args){
       console.log('logIn', args);
       _$log_form.addClass('ajax-loading');
@@ -110,7 +108,6 @@
         }
       });
     };
-
     function getStudioLinkBlock(){
       var path = _origin+_base_url+'edlp/ajax/blocks/json/';
       $.getJSON(path+"studiolinkblock", {})
@@ -119,7 +116,6 @@
           console.warn('Studio ink block load failed', jqxhr.responseText);
         });
     };
-
     function onStudioLinkBlockLoaded(data){
       console.log('onStudioLinkBlockLoaded', data);
       $('#block-studiouserlogin').replaceWith(data.blocks.studiolinkblock.rendered);
@@ -587,6 +583,7 @@
     };
 
     function onCloseModal(e){
+      console.log("onCloseModal");
       // check for theme attribute and emmit event
       var $col = $(this).parents('.col');
       var theme = $col.attr('theme');
@@ -1824,7 +1821,6 @@
         }
       }
     };
-
     function checkGridBlockHeight(){
       // console.log('checkGridBlockHeight');
       // if(_is_mobile) return;
@@ -1846,7 +1842,6 @@
         $this.height(Math.min($this.attr('init-height'), _$row.height()));
       });
     };
-
     function checkGridBlockVisible(){
       // console.log('checkGridBlockVisible');
       // if(_is_mobile) return;
@@ -2049,6 +2044,8 @@
       _$ajaxLinks.removeClass('is-active');
       _$body.trigger({'type':'all-modal-closed'});
       // checkRowEmpty();
+
+      checkVisibleCorpusMapSpace();
     };
 
     function checkRowEmpty(){

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