Fix some splitter issues for bug 460252 - Today Pane Integration in the new Thunderbird tab model (currently not available in mail tab). r=ssitter
authorPhilipp Kewisch <mozilla@kewis.ch>
Sun, 08 Mar 2009 22:26:13 +0100
changeset 2159 694a773f7a8a9526b97422fd45e3de9d30ce6366
parent 2158 e55ac9750066dff863d7203a5ae85dbfa0ea6c05
child 2160 99320ed86776308bad01657cd5655caaf2ede04a
push id1748
push usermozilla@kewis.ch
push dateSun, 08 Mar 2009 21:26:23 +0000
treeherdercomm-central@694a773f7a8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersssitter
bugs460252
Fix some splitter issues for bug 460252 - Today Pane Integration in the new Thunderbird tab model (currently not available in mail tab). r=ssitter
calendar/base/content/calendar-common-sets.xul
calendar/base/content/today-pane.js
calendar/base/content/today-pane.xul
--- a/calendar/base/content/calendar-common-sets.xul
+++ b/calendar/base/content/calendar-common-sets.xul
@@ -105,22 +105,19 @@
     <command id="calendar_toggle_orientation_command" persist="checked" oncommand="toggleOrientation()" disabled="true"/>
     <command id="calendar_toggle_workdays_only_command" persist="checked" oncommand="toggleWorkdaysOnly()"/>
     <command id="calendar_toggle_tasks_in_view_command" persist="checked" oncommand="toggleTasksInView()"/>
     <command id="calendar_toggle_show_completed_in_view_command" persist="checked" oncommand="toggleShowCompletedInView()"/>
     <command id="calendar_toggle_minimonthpane_command" oncommand="document.getElementById('minimonth-pane').togglePane(event)"/>
     <command id="calendar_toggle_calendarlist_command" oncommand="document.getElementById('calendar-list-pane').togglePane(event)"/>
     <command id="calendar_task_filter_command" oncommand="taskViewUpdate(event.explicitOriginalTarget.getAttribute('value'))"/>
     <command id="calendar_toggle_filter_command" oncommand="document.getElementById('task-filter-pane').togglePane(event)"/>
-    <command id="calendar_toggle_todaypane_command"
-             oncommand="document.getElementById('today-pane-panel').togglePane(event); TodayPane.setTodayHeader()"/>
     <command id="calendar_view_next_command" oncommand="currentView().moveView(1)"/>
     <command id="calendar_view_today_command" oncommand="currentView().moveView()"/>
     <command id="calendar_view_prev_command" oncommand="currentView().moveView(-1)"/>
-
     <command id="calendar_go_to_today_command" oncommand="goToDate(now())"/>
   </commandset>
 
   <keyset id="calendar-keys">
 #ifdef XP_MACOSX
     // The following Mac specific code-lines are necessary, because you can't 
     // just use the OPTION key on Mac OSX. So we will use SHIFT+OPTION on the 
     // Mac, but just ALT on all other platforms. See bug 448946.
--- a/calendar/base/content/today-pane.js
+++ b/calendar/base/content/today-pane.js
@@ -50,17 +50,22 @@ var TodayPane = {
    */
   onLoad: function onLoad() {
       this.paneViews = [ calGetString("calendar", "eventsandtasks"), calGetString("calendar", "tasksonly"), calGetString("calendar", "eventsonly") ];
       agendaListbox.setupCalendar();
       this.initializeMiniday();
       this.setShortWeekdays();
       document.getElementById("modeBroadcaster").addEventListener("DOMAttrModified", this.onModeModified, false);
       this.setTodayHeader();
-      document.getElementById("today-splitter").addEventListener("command", onCalendarViewResize, false);
+
+      let panel =  document.getElementById('today-pane-panel');
+      let splitter = document.getElementById("today-splitter");
+      splitter.addEventListener("command", onCalendarViewResize, false);
+      splitter.hidden = !panel.isVisible();
+
   },
 
   /**
    * Unload handler, cleans up the today pane on window unload.
    */
   onUnload: function onUnload() {
       document.getElementById("modeBroadcaster").removeEventListener("DOMAttrModified", this.onModeModified, false);
       document.getElementById("today-splitter").removeEventListener("command", onCalendarViewResize, false);
@@ -300,16 +305,22 @@ var TodayPane = {
   onModeModified: function onModeModified(aEvent) {
       if (aEvent.attrName == "mode") {
           TodayPane.setTodayHeader();
           var todaypanebox = document.getElementById("today-pane-panel");
           if (todaypanebox.isVisible()) {
               document.getElementById("today-splitter").setAttribute("state", "open");
           }
       }
+  },
+  toggleVisibility: function toggleVisbility(aEvent) {
+      let panel =  document.getElementById('today-pane-panel');
+      panel.togglePane(aEvent);
+      document.getElementById('today-splitter').hidden = !panel.isVisible();
+      TodayPane.setTodayHeader();
   }
 };
 
 /**
  * Wrapped load function called on window load
  */
 function loadTodayPane() {
     TodayPane.onLoad();
--- a/calendar/base/content/today-pane.xul
+++ b/calendar/base/content/today-pane.xul
@@ -246,9 +246,13 @@
                   collapsedinmodes="mail,task"
                   broadcaster="modeBroadcaster"
                   persist="height collapsedinmodes"
                   ondraggesture="nsDragAndDrop.startDrag(event, calendarTaskButtonDNDObserver);"
                   ondragover="nsDragAndDrop.dragOver(event, calendarTaskButtonDNDObserver);"
                   ondragdrop="nsDragAndDrop.drop(event, calendarTaskButtonDNDObserver);"/>
     </vbox>
   </modevbox>
+
+  <commandset id="calendar_commands">
+    <command id="calendar_toggle_todaypane_command" oncommand="TodayPane.toggleVisibility(event)"/>
+  </commandset>
 </overlay>