Closed Bug 417241 Opened 16 years ago Closed 13 years ago

Delete button should be disabled when focus is on agenda pane and selected Event is readonly

Categories

(Calendar :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: berend.cornelius09, Unassigned)

Details

Attachments

(1 file)

When I tried to implement a solution for this in calendar-common-sets.js. I found out that although my code was seemingly executed correctly I would not toggle the delete-button correctly I debugged into
Thunderbird's Code in "_getControllerForCommand" in globalOverlay.js and I
could clearly see that the wrong commandcontroller was returned when the
command is disabled. To solve the problem one would have to implement an own
command updater:

>   _getControllerForCommand: function(command) {
>     try {
>       var controller = 
>       top.document.commandDispatcher.getControllerForCommand(command);
>       if (controller && controller.isCommandEnabled(command))
>         return controller;
>    }
>     catch(e) {
>     }
>     var controllerCount = window.controllers.getControllerCount();
>     for (var i = 0; i < controllerCount; ++i) {
>       var current = window.controllers.getControllerAt(i);
>       try {
>         if (current.supportsCommand(command) && >current.isCommandEnabled(command))
>         return current;
>      }
>      catch (e) {
>      }
>    }
>    return controller || window.controllers.getControllerForCommand(command);
>   },
Attached patch patch — — Splinter Review
The patch attached shows the current state of my implementation about this problem. It will not apply anymore
WFM in latest code, the selection code will soon be revised anyways.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: