Fix bug 680870 - Fix a few minor issues in the calendar list binding. r=philipp
authorLennart Bublies <Lennart.Bublies@gmx.de>
Mon, 22 Aug 2011 04:57:00 +0200
changeset 9127 dcf1dbceb40dd92bc3f3fd09d3bfd8ebec661004
parent 9126 83a9601b834c1f1d9b54c56f7bbfd4f66af1c8c0
child 9128 c38b285291d906ac13a0fe6daabb27ea0c33dc85
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs680870
Fix bug 680870 - Fix a few minor issues in the calendar list binding. r=philipp
calendar/base/content/widgets/calendar-list-tree.xml
--- a/calendar/base/content/widgets/calendar-list-tree.xml
+++ b/calendar/base/content/widgets/calendar-list-tree.xml
@@ -185,17 +185,18 @@
       })
       ]]></field>
     </implementation>
     <handlers>
       <handler event="dblclick"><![CDATA[
         var col = {};
         var calendar = this.getCalendarFromEvent(event, col);
         if (event.button != 0 ||
-            (col.value && col.value.id == "calendar-list-tree-checkbox")) {
+            (col.value && col.value.element &&
+             col.value.element.getAttribute("anonid") == "checkbox-treecol")) {
             // Only left clicks that are not on the checkbox column
             return;
         }
         if (calendar) {
             openCalendarProperties(calendar);
         } else {
             openCalendarWizard();
         }
@@ -297,17 +298,17 @@
 
         onPropertyChanged: function cMO_onPropertyChanged(aCalendar,
                                                           aName,
                                                           aValue,
                                                           aOldValue) {
             switch (aName) {
                 case "color":
                     // TODO See other TODO in this file about updateStyleSheetForViews
-                    if (updateStyleSheetForViews) {
+                    if ("updateStyleSheetForViews" in window) {
                         updateStyleSheetForViews(aCalendar);
                     }
                     this.listTree.updateCalendarColor(aCalendar);
                     // Fall through, update item in any case
                 case "name":
                 case "currentStatus":
                 case "readOnly":
                 case "disabled":
@@ -515,17 +516,17 @@
 
           this.updateCalendarColor(aCalendar);
 
           // TODO This should be done only once outside of this binding, but to
           // do that right, we need to have an easy way to register an observer
           // all calendar properties. This could be the calendar manager that
           // holds an observer on every calendar anyway, which would then use the
           // global observer service which clients can register with.
-          if (updateStyleSheetForViews) {
+          if ("updateStyleSheetForViews" in window) {
               updateStyleSheetForViews(aCalendar);
           }
 
           // Watch the calendar for changes, i.e color.
           aCalendar.addObserver(this.calObserver);
 
           // Adding a calendar causes the sortorder to be changed.
           this.sortOrderChanged();