Author: jablko
Date: Wed Oct 13 08:32:00 2010
New Revision: 8080

Log:
Make JavaScript and CSS generic, to work with .description in any containing 
element. Use <label/> only for form inputs, not headings

Modified:
   trunk/css/edit.css
   trunk/js/description.js
   trunk/plugins/sfClassicPlugin/css/main.css
   trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php

Modified: trunk/css/edit.css
==============================================================================
--- trunk/css/edit.css  Wed Oct 13 07:45:00 2010        (r8079)
+++ trunk/css/edit.css  Wed Oct 13 08:32:00 2010        (r8080)
@@ -1,12 +1,11 @@
+form .section,
 .form-item
 {
   position: relative;
 }
 
-.form-item .description-left,
-.form-item .description-right,
-.yui-dialog .description-left,
-.yui-dialog .description-right
+.description-left,
+.description-right
 {
   background: #def;
 
@@ -16,23 +15,21 @@
 
   color: #000;
   display: none;
-  z-index: 1;
   padding: 1em;
   position: absolute;
   top: 0;
   width: 156px;
+  z-index: 1;
 }
 
-.form-item .description-left,
-.yui-dialog .description-left
+.description-left
 {
-  right: 100%;
   margin-right: 3em;
+  right: 100%;
 }
 
-.form-item .description-right,
-.yui-dialog .description-right
+.description-right
 {
   left: 100%;
   margin-left: 3em;
-}
\ No newline at end of file
+}

Modified: trunk/js/description.js
==============================================================================
--- trunk/js/description.js     Wed Oct 13 07:45:00 2010        (r8079)
+++ trunk/js/description.js     Wed Oct 13 08:32:00 2010        (r8080)
@@ -5,9 +5,9 @@
     Drupal.behaviors.description = {
       attach: function (context)
         {
-          $('.form-item .description', context).hide();
+          $('.description', context).hide();
 
-          $('.form-item', context)
+          $(':has(> .description)', context)
             .focusin(function ()
               {
                 var $this = $(this);
@@ -15,11 +15,14 @@
                 var $sidebar = $('#sidebar-first');
                 var $content = $('#content');
 
-                /*
-                 * Let's see what is the best position,
-                 * - Right side (class description-right): tooltip top 
position in the document shouldn't be in conflict with the sidebar
-                 * - Left side (class description-left): tooltip width must 
fit in the space between the form fieldset and the left of the document
-                 * - Bottom (class description): when right and left sides 
don't work */
+                // Let's see what is the best position,
+                // - Right side (class description-right): tooltip top position
+                // in the document shouldn't be in conflict with the sidebar
+                // - Left side (class description-left): tooltip width must fit
+                // in the space between the form fieldset and the left of the
+                // document
+                // - Bottom (class description): when right and left sides
+                // don't work */
                 if ($this.offset().top <= $sidebar.offset().top + 
$sidebar.height())
                 {
                   // I have to render the tooltip to get tooltipWidth value

Modified: trunk/plugins/sfClassicPlugin/css/main.css
==============================================================================
--- trunk/plugins/sfClassicPlugin/css/main.css  Wed Oct 13 07:45:00 2010        
(r8079)
+++ trunk/plugins/sfClassicPlugin/css/main.css  Wed Oct 13 08:32:00 2010        
(r8080)
@@ -4,6 +4,13 @@
   word-wrap: break-word;
 }
 
+form h3,
+.form-item label
+{
+  font: inherit;
+  font-weight: bold;
+}
+
 form .field
 {
   /* Reset .field */

Modified: 
trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php
==============================================================================
--- trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php     
Wed Oct 13 07:45:00 2010        (r8079)
+++ trunk/plugins/sfRadPlugin/modules/sfRadPlugin/templates/editSuccess.php     
Wed Oct 13 08:32:00 2010        (r8080)
@@ -43,18 +43,17 @@
       ->help(__('"At the item level of description, transcribe explicit 
statements of responsibility appearing in conjunction with the formal title 
proper in or on the chief source of information..." (RAD 1.1F)'))
       ->label(__('Statement of responsibility')), $rad) ?>
 
-    <div class="form-item">
+    <div class="section">
 
-      <label><?php echo __('Title notes') ?></label>
+      <h3><?php echo __('Title notes') ?></h3>
 
       <table class="inline">
 
         <thead>
           <tr>
             <th style="width: 65%">
-              <?php echo __('Note') ?>
             </th><th style="width: 30%">
-              <?php echo __('Title note type') ?>
+              <?php echo __('Note type') ?>
             </th><th style="width: 5%">
             </th>
           </tr>

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to