Browse Source

fixed minor issue related to #783

Stephen Ficklin 5 years ago
parent
commit
ae96ee878b

+ 0 - 8
tripal/includes/TripalFields/TripalField.inc

@@ -208,14 +208,6 @@ class TripalField {
     return $this->instance;
   }
 
-  /**
-   * When constructing a pager for use by a field, all pagers must have
-   * a unique ID
-   */
-  protected function getPagerElementID() {
-    return $this->field['id'];
-  }
-
   public function getFieldTerm() {
     return $this->term;
   }

+ 0 - 8
tripal/includes/TripalFields/TripalFieldFormatter.inc

@@ -167,14 +167,6 @@ class TripalFieldFormatter {
 
   }
 
-  /**
-   * When constructing a pager for use by a field, all pagers must have
-   * a unique ID
-   */
-  protected function getPagerElementID() {
-    return $this->field['id'];
-  }
-
   /**
    * Updates a pager generated by theme('pager') for use with AJAX.
    *

+ 2 - 5
tripal/theme/js/tripal.js

@@ -208,18 +208,15 @@
 
 // Used for ajax update of fields by links in a pager.
 function tripal_navigate_field_pager(id, page) {
-  jQuery(document).ajaxStart(function () {
-    jQuery('#' + id + '-spinner').show();
-  }).ajaxComplete(function () {
-    jQuery('#' + id + '-spinner').hide();
-  });
 
+  jQuery('#' + id + '-spinner').show();
   jQuery.ajax({
     type   : 'GET',
     url    : Drupal.settings['basePath'] + 'bio_data/ajax/field_attach/' + id,
     data   : {'page': page},
     success: function (response) {
       jQuery('#' + id + ' .field-items').replaceWith(response['content']);
+      jQuery('#' + id + '-spinner').hide();
     }
   });
 }

+ 1 - 1
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -119,7 +119,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
     $items_per_page = array_key_exists('items_per_page', $this->instance['settings']) ? $this->instance['settings']['items_per_page'] : 10;
     $total_records = count($rows);
     $total_pages = (int) ($total_records / $items_per_page) + 1;
-    $pelement = 0; //$this->getPagerElementID();
+    $pelement = 0;
     $current_page = pager_default_initialize($total_records, $items_per_page, $pelement);
     $pager = theme('pager', [
       'tags' => [],