Просмотр исходного кода

Merge branch '7.x-3.x' of github.com:tripal/tripal into 7.x-3.x

Stephen Ficklin 7 лет назад
Родитель
Сommit
c906cec053
2 измененных файлов с 57 добавлено и 20 удалено
  1. 31 0
      tripal/tripal.drush.inc
  2. 26 20
      tripal_ds/theme/js/tripal_ds.js

+ 31 - 0
tripal/tripal.drush.inc

@@ -154,6 +154,37 @@ function drush_tripal_set_user($username) {
   }
 }
 
+/**
+ * Executes jobs in the Tripal Jobs Queue.
+ *
+ * Executed when 'drush trp-run-job' is called.
+ *
+ * @ingroup tripal_drush
+ */
+function drush_tripal_trp_run_jobs_install($username) {
+  $parallel = drush_get_option('parallel');
+  $job_id   = drush_get_option('job_id');
+  $max_jobs = drush_get_option('max_jobs', -1);
+  $single   = drush_get_option('single', 0);
+
+  drush_tripal_set_user($username);
+
+  drush_print("\n" . date('Y-m-d H:i:s'));
+  if ($parallel) {
+    drush_print("Tripal Job Launcher (in parallel)");
+    if ($max_jobs !== -1) drush_print("Maximum number of jobs is " . $max_jobs);
+    drush_print("Running as user '$username'");
+    drush_print("-------------------");
+    tripal_launch_job($parallel, $job_id, $max_jobs, $single);
+  }
+  else {
+    drush_print("Tripal Job Launcher");
+    drush_print("Running as user '$username'");
+    drush_print("-------------------");
+    tripal_launch_job(0, $job_id, $max_jobs, $single);
+  }
+}
+
 /**
  * Executes jobs in the Tripal Jobs Queue.
  *

+ 26 - 20
tripal_ds/theme/js/tripal_ds.js

@@ -36,28 +36,34 @@
       });
       // Move the tripal pane to the first position when its TOC item is clicked.
       $('.tripal_pane-toc-list-item-link').each(function (i) {
+        var id = '.tripal_pane-fieldset-' + $(this).attr('id');
+        if ($(id).length === 0) {
+            $(this).parents('.views-row').first().remove();
+            return;
+        }
         $(this).click(function() {
-          var id = '.tripal_pane-fieldset-' + $(this).attr('id');
           var prevObj = $(id).prev().attr('class');
-
-            // Highlight the fieldset instead of moving if it's already at the top
-            if (prevObj.indexOf('group-tripal-pane-content-top') == 0) {
-              $(id).fadeTo(10, 0.3, function() {});
-              $(id).fadeTo(200, 1, function() {});
-            }
-            if ($(id).hasClass('hideTripalPane')) {
-              $(id).removeClass('hideTripalPane');
-              $(id).addClass('showTripalPane');
-            }
-            $(id).hide();
-            var obj = $(id).detach();
-            $('.group-tripal-pane-content-top').after(obj);
-            $(id).show(300, function () {
-              // Trigger expansion event to allow the pane content
-              // to react to the size change
-              $(id).trigger($.Event('tripal_ds_pane_expanded', {id: id}));
-            });
-            return false;
+          if(prevObj.length === 0) {
+            return;
+          }
+          // Highlight the fieldset instead of moving if it's already at the top
+          if (prevObj.indexOf('group-tripal-pane-content-top') == 0) {
+            $(id).fadeTo(10, 0.3, function() {});
+            $(id).fadeTo(200, 1, function() {});
+          }
+          if ($(id).hasClass('hideTripalPane')) {
+            $(id).removeClass('hideTripalPane');
+            $(id).addClass('showTripalPane');
+          }
+          $(id).hide();
+          var obj = $(id).detach();
+          $('.group-tripal-pane-content-top').after(obj);
+          $(id).show(300, function () {
+            // Trigger expansion event to allow the pane content
+            // to react to the size change
+            $(id).trigger($.Event('tripal_ds_pane_expanded', {id: id}));
+          });
+          return false;
         });
       });
     }