Revision: 2100
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2100&view=rev
Author:   cimorrison
Date:     2011-10-17 18:55:53 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
Fixed bug which meant that bookings were sometimes out by one slot when 
resizing with $times_along_top set to TRUE.

Modified Paths:
--------------
    mrbs/branches/draggable_bookings/web/Themes/default/header.inc
    mrbs/branches/draggable_bookings/web/functions_table.inc
    mrbs/branches/draggable_bookings/web/mrbs.css.php

Modified: mrbs/branches/draggable_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-16 19:51:27 UTC (rev 2099)
+++ mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-17 18:55:53 UTC (rev 2100)
@@ -1294,6 +1294,12 @@
       // objects has a key property which holds the name of the data attribute 
and a
       // data object, which is an array of objects holding the coordinate and 
data
       // value at each cell boundary.
+      //
+      // Note that jQuery.offset() measures to the top left hand corner of the 
content
+      // and does not take into account padding.   So we need to make sure 
that the padding-top
+      // and padding-left is the same for all elements that we are going to 
measure so
+      // that we can compare them properly.   It is simplest to use zero and 
put any
+      // padding required on the contained element.
       ?>
       tableData.x = {};
       tableData.x.data = [];

Modified: mrbs/branches/draggable_bookings/web/functions_table.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/functions_table.inc    2011-10-16 
19:51:27 UTC (rev 2099)
+++ mrbs/branches/draggable_bookings/web/functions_table.inc    2011-10-17 
18:55:53 UTC (rev 2100)
@@ -734,6 +734,9 @@
       // Put the number of seconds since the start of the day (nominal, 
ignoring DST)
       // in a data attribure so that JavaScript can pick it up
       $header_inner .= "<th data-seconds=\"$slot_seconds\" style=\"width: 
$column_width%\">";
+      // We need the span so that we can apply some padding.   We can't apply 
it
+      // to the <th> because that is used by jQuery.offset() in resizable 
bookings
+      $header_inner .= "<span>";
       if ( $enable_periods )
       {
         // convert timestamps to HHMM format without leading zeros
@@ -746,6 +749,7 @@
       {
         $header_inner .= utf8_strftime(hour_min_format(),$t);
       }
+      $header_inner .= "</span>";
       $header_inner .= "</th>\n";
     }
     // next: line to display times on right side
@@ -1062,6 +1066,9 @@
       // Put the seconds since the start of the day (nominal, not adjusted for 
DST)
       // into a data attribute so that it can be picked up by JavaScript
       $header_inner .= "<th data-seconds=\"$slot_seconds\" style=\"width: 
$column_width%\">";
+      // We need the span so that we can apply some padding.   We can't apply 
it
+      // to the <th> because that is used by jQuery.offset() in resizable 
bookings
+      $header_inner .= "<span>";
       if ( $enable_periods )
       {
         // convert timestamps to HHMM format without leading zeros
@@ -1074,6 +1081,7 @@
       {
         $header_inner .= utf8_strftime(hour_min_format(),$t);
       }
+      $header_inner .= "</span>";
       $header_inner .= "</th>\n";
     }
     // next: line to display times on right side

Modified: mrbs/branches/draggable_bookings/web/mrbs.css.php
===================================================================
--- mrbs/branches/draggable_bookings/web/mrbs.css.php   2011-10-16 19:51:27 UTC 
(rev 2099)
+++ mrbs/branches/draggable_bookings/web/mrbs.css.php   2011-10-17 18:55:53 UTC 
(rev 2100)
@@ -188,10 +188,17 @@
     border-bottom: 0;
     border-right: 0}
 .dwm_main td:first-child {border-left: 0}
-.dwm_main th {font-size: small; font-weight: normal; vertical-align: top; 
padding: 0 2px;
+<?php
+// Note that it is important to have zero padding-left and padding-top on the 
th cells and the celldiv divs.
+// These elements are used to calculate the offset top and left of the 
position of bookings in
+// the grid when using resizable bookings.   jQuery.offset() measures to the 
content.  If you
+// need padding put it on the contained element.
+?>
+.dwm_main th {font-size: small; font-weight: normal; vertical-align: top; 
padding: 0;
     color: <?php echo $header_font_color ?>; 
     background-color: <?php echo $header_back_color ?>;
     border-left: <?php echo $main_table_cell_border_width ?>px solid <?php 
echo $main_table_header_border_color ?>}
+.dwm_main th.first_last, .dwm_main th span {padding: 0 2px}
 .dwm_main th:first-child {border-left: 0}
 .dwm_main a {display: block; min-height: inherit}
 .dwm_main tbody a {padding: 0 2px}

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to