Browse Source

Made a few formatting fixes for the TripalPane close button

Stephen Ficklin 7 years ago
parent
commit
f9c6830610

+ 6 - 1
tripal_ds/theme/css/tripaldsfeature.css → tripal_ds/theme/css/tripal_ds.css

@@ -69,4 +69,9 @@ span.download-icon {
     border: none;
 }
 
-
+.tripal_pane-fieldset-buttons {
+  float: right;
+  cursor: pointer;
+  margin-top: 4px;
+  color: #777777;
+}

+ 10 - 12
tripal_ds/theme/js/tripal_ds.js

@@ -5,19 +5,18 @@
 
       // Add a close button for each pane except for the te_base
       $('div.tripal_pane').each(function (i) {
-        $(this).prepend('<div class="tripal_pane-fieldset-close_button">'+
-              '<div id="tripal-pane-close-button" class="tripal-pane-button">'+
-                '<i class="fa fa-window-close-o fa-lg"></i>'+
-              '</div>'+
-            '</div>'
-           );
+        $(this).prepend(
+          '<div class="tripal_pane-fieldset-buttons">' +
+            '<div id="tripal-pane-close-button" class="tripal-pane-button">' +
+              '<i class="fa fa-window-close-o fa-lg"></i>' +
+            '</div>' +
+          '</div>'
+        );
         var id = '.tripal_pane-fieldset-' + $(this).attr('id');
       });
+
       // Hide the pane when the close button is clicked
-      $('.tripal_pane-fieldset-close_button').each(function (i) {
-        $(this).css('float', 'right');
-        $(this).css('cursor', 'pointer');
-        $(this).css('margin', '0px 5px');
+      $('#tripal-pane-close-button').each(function (i) {
         $(this).click(function () {
           var fs = $(this).parents('div.tripal_pane');
           if($(fs).hasClass('showTripalPane'))  {
@@ -37,8 +36,7 @@
             // If the user clicks on other TOC item, move its fieldset to the top 
             $(id + ' fieldset').removeClass('collapsed');
             $(id + ' fieldset .fieldset-wrapper').show();
-            console.log(prevObj);
-            console.log(id);
+
             // Highlight the fieldset instead of moving if it's already at the top
             if (prevObj.indexOf('group-tripal-pane-content-top') == 0) {
               $(id + ' fieldset').fadeTo(10, 0.3, function() {});

+ 1 - 1
tripal_ds/tripal_ds.info

@@ -5,7 +5,7 @@ project = tripal
 package = Tripal
 version = 7.x-3.0-beta3
 
-stylesheets[all][] = theme/css/tripaldsfeature.css
+stylesheets[all][] = theme/css/tripal_ds.css
 
 dependencies[] = ds
 dependencies[] = field_group

+ 2 - 2
tripal_ds/tripal_ds.module

@@ -6,7 +6,7 @@ require_once "includes/tripal_ds.field_group.inc";
 require_once "includes/tripal_ds.field_formatter.inc";
 
 function tripal_ds_init() {
-  drupal_add_css(drupal_get_path('module', 'tripal_ds') . '/theme/css/tripaldsfeature.css');
+  drupal_add_css(drupal_get_path('module', 'tripal_ds') . '/theme/css/tripal_ds.css');
   drupal_add_js(drupal_get_path('module', 'tripal_ds') . '/theme/js/tripal_ds.js');
 
   $theme_dir = url(drupal_get_path('module', 'tripal_ds') . '/theme');
@@ -425,7 +425,7 @@ function tripal_ds_field_display_alter(&$display, $context){
     $bundle = $context['entity']->bundle;
     $bundle_info = tripal_load_bundle_entity(array('name' => $bundle));
     $hide_variable = tripal_get_bundle_variable('hide_empty_field', $bundle_info->id, 'hide');
-  
+
     if ($field_name && ($hide_variable == 'hide')) {
       $item = field_get_items('TripalEntity', $context['entity'], $field_name);
       $field = field_info_field($field_name);