Encapsulate month view, remove unnecessary CSS rules.
authorJan Schneider <jan@horde.org>
Mon, 30 Mar 2009 22:40:33 +0000 (00:40 +0200)
committerJan Schneider <jan@horde.org>
Mon, 30 Mar 2009 22:40:33 +0000 (00:40 +0200)
kronolith/js/src/kronolith.js
kronolith/templates/index/month.inc
kronolith/themes/screen.css

index a5b3fdd..a907e5a 100644 (file)
@@ -307,7 +307,6 @@ KronolithCore = {
 
                 this.updateView(date, loc);
                 if ($('kronolithView' + locCap)) {
-                    $('kronolithViewHead').appear();
                     $('kronolithView' + locCap).appear();
                 }
                 this.updateMinical(date, loc);
@@ -349,7 +348,7 @@ KronolithCore = {
             break;
 
         case 'month':
-            var tbody = $('kronolithViewMonth').down('.kronolithViewBody'),
+            var tbody = $('kronolithViewMonthBody'),
                 dates = this.viewDates(date, view),
                 day = dates[0].clone(), rows = 0, row;
 
@@ -634,7 +633,7 @@ KronolithCore = {
                         $('kronolithMonthDay' + date.key).insert(div);
                         if (event.value.e) {
                             div.setStyle({ 'cursor': 'move' });
-                            new Drag('kronolithEventmonth' + r.response.cal + event.key, { threshold: 5, parentElement: function() { return $('kronolithViewMonth').select('.kronolithViewBody')[0]; }, snapToParent: true });
+                            new Drag('kronolithEventmonth' + r.response.cal + event.key, { threshold: 5, parentElement: function() { return $('kronolithViewMonthBody'); }, snapToParent: true });
                         }
                         break;
                     }
index c277dcf..40a3193 100644 (file)
@@ -1,4 +1,5 @@
-<table id="kronolithViewHead" class="kronolithView" style="display:none">
+<div id="kronolithViewMonth" style="display:none">
+<table id="kronolithViewHead" class="kronolithView">
   <tr>
     <td class="kronolithFirstCol">&nbsp;</td>
     <?php for ($w = $prefs->getValue('week_start_monday'), $i = $w, $c = $i + 7; $i < $c; $i++): ?>
@@ -8,8 +9,8 @@
 </table>
 
 <div id="kronolithViewMonthContainer">
-<table id="kronolithViewMonth" class="kronolithView kronolithViewMonth" style="display:none;">
-<tbody class="kronolithViewBody">
+<table class="kronolithView kronolithViewMonth">
+<tbody id="kronolithViewMonthBody">
   <tr id="kronolithRowTemplate" class="kronolithRow" style="display:none">
     <td class="kronolithFirstCol"></td>
     <td class="kronolithCol<?php if ($w == 6 || $w == 0) echo ' kronolithWeekend' ?>">
@@ -36,4 +37,5 @@
   </tr>
 </tbody>
 </table>
-</div>
\ No newline at end of file
+</div>
+</div>
index f07b9fb..350adab 100644 (file)
@@ -932,9 +932,6 @@ div.kronolithView div.kronolithViewBody div.kronolithRow {
 }
 
 /* Main view month */
-.kronolithViewMonth div.kronolithViewBody div.kronolithRow div {
-    height: 86px;
-}
 #kronolithViewMonthContainer {
     position: absolute;
     top: 24px;
@@ -996,19 +993,6 @@ div.kronolithView div.kronolithViewBody div.kronolithRow div .kronolithCorner {
     height: auto;
     border: none;
 }
-div.kronolithViewMonth div.kronolithViewBody div.kronolithRow div.kronolithDay {
-    display: inline;
-    width: 15px;
-    height: 15px;
-    line-height: 15px;
-    margin: 0 2px 2px 0;
-    padding: 0;
-    border-width: 0 1px 1px 0;
-    text-align: center;
-    vertical-align: middle;
-    font-weight: bold;
-    cursor: pointer;
-}
 div.kronolithView div.kronolithViewBody div.kronolithRow div a.kronolithAdd {
     display: inline;
     width: 15px;