浏览代码

remove field from sio annotation

bradfordcondon 6 年之前
父节点
当前提交
d375999c5c

+ 1 - 3
tripal_chado/includes/TripalFields/data__sequence_features/data__sequence_features.inc

@@ -61,18 +61,16 @@ class data__sequence_features extends ChadoField {
 
     parent::load($entity);
     $field = get_class($this);
-
     $parent = $entity->chado_record->feature_id;
-
     $children = $this->findChildFeatures($parent);
     if (empty($children)) {
       unset($entity->{$field});
       return;
     }
+
     $i = 0;
     foreach ($children as $child_id => $child) {
       $entity->{$field}['und'][$i]['value'] = $child;
-
       $i++;
     }
 

+ 3 - 2
tripal_chado/includes/TripalFields/data__sequence_features/data__sequence_features_formatter.inc

@@ -59,7 +59,7 @@ class data__sequence_features_formatter extends ChadoFieldFormatter {
     $settings = $display['settings'];
     $parent = $entity->chado_record->feature_id;
 
-    drupal_add_js("https://cdn.rawgit.com/calipho-sib/feature-viewer/v1.0.0/dist/feature-viewer.bundle.js", [
+    drupal_add_js("https://cdn.rawgit.com/calipho-sib/feature-viewer/v1.0.4/dist/feature-viewer.bundle.js", [
       'type' => 'external',
       'scope' => 'header',
       'group' => 15,
@@ -67,6 +67,7 @@ class data__sequence_features_formatter extends ChadoFieldFormatter {
       'weight' => 500,
     ]);
 
+
     $child_draw = [];
     $sequence = $entity->data__sequence['und'][0]['value'];
 
@@ -100,7 +101,7 @@ class data__sequence_features_formatter extends ChadoFieldFormatter {
           ],
         ],
         // JS to render collapsible fieldsets properly.
-        '#attached' => ['js' => ['misc/collapse.js', 'misc/form.js']],
+        //'#attached' => ['js' => ['misc/collapse.js', 'misc/form.js']],
       ];
       // The featureviewer drawing div.
       $element[$i]['drawing'] = [

+ 0 - 14
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation.inc

@@ -328,20 +328,6 @@ class sio__annotation extends ChadoField {
         $entity->{$field_name}['und'][$i]['chado-' . $field_table . '__pub_id'] = $linker->pub_id;
       }
     }
-
-
-    //  Deal with annotations from child features and their children.
-    // TODO: only check if we're attached to a feature that's a gene.
-    // TODO: filter out chado_expand_var stuff that isnt feature_relationship
-
-
-    $master = $entity->data__sequence_features['und'];
-
-    if ($master && !empty($master)) {
-
-      $entity->{$field_name}['und'][0]['child_annotations'] = $master;
-    }
-
   }
 }
 

+ 1 - 11
tripal_chado/includes/TripalFields/sio__annotation/sio__annotation_formatter.inc

@@ -77,23 +77,13 @@ class sio__annotation_formatter extends ChadoFieldFormatter {
         '#markup' => theme_table($table),
       );
     }
-
-
-    $rows = $this->getAnnotationRows($child);
-    $header = ['name', 'type', 'annotation'];
-
-    $table = theme('table', ['rows' => $rows, 'header' => $header]);
-    $element[0][$i]['annotation_table'] = [
-      '#markup' => $table,
-      '#title' => t("Annotations for !root", ['!root' => $name]),
-    ];
-
   }
 
 
 
   /**
    * Get annotations for child features, from the data__sequence_features field.
+   * Possibly not used.
    *
    * @param $data
    */

+ 4 - 4
tripal_chado/includes/tripal_chado.fields.inc

@@ -602,7 +602,7 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
     ]);
     $field_name = 'data__sequence_features';
     $field_type = 'data__sequence_features';
-    $fields[$field_name] = [
+    $info[$field_name] = [
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
@@ -619,7 +619,7 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
     ]);
     $field_name = 'local__child_properties';
     $field_type = 'local__child_properties';
-    $fields[$field_name] = [
+    $info[$field_name] = [
       'field_name' => $field_name,
       'type' => $field_type,
       'cardinality' => 1,
@@ -2251,7 +2251,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
 
   if (isset($bundle->data_table) and ($bundle->data_table == 'feature') and $bundle->term->name == 'gene') {
     $field_name = 'data__sequence_features';
-    $instances[$field_name] = [
+    $info[$field_name] = [
       'field_name' => $field_name,
       'entity_type' => $entity_type,
       'bundle' => $bundle->name,
@@ -2280,7 +2280,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
       ],
     ];
     $field_name = 'local__child_properties';
-    $instances[$field_name] = [
+    $info[$field_name] = [
       'field_name' => $field_name,
       'entity_type' => $entity_type,
       'bundle' => $bundle->name,

+ 19 - 0
tripal_chado/theme/js/tripal_chado_data_sequence_features_featureloc.js

@@ -42,4 +42,23 @@
             })
         })
     }
+
+    // Trigger a window resize event to notify charting modules that
+    // the container dimensions has changed
+
+    $(document).on('collapsed', function (e) {
+        setTimeout(function () {
+            if (typeof Event !== 'undefined') {
+                window.dispatchEvent(new Event('resize'));
+            }
+            else {
+                // Support IE
+                var event = window.document.createEvent('UIEvents');
+                event.initUIEvent('resize', true, false, window, 0);
+                window.dispatchEvent(event);
+            }
+        }, 1000)
+    });
+
+
 })(jQuery);