Fix bug 482110 - calendar stays hidden after adding event to it; new event not visible (regression). r=decathlon

This commit is contained in:
Philipp Kewisch 2011-07-26 16:40:17 +02:00
Родитель ee9f70e875
Коммит 021555173b
3 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -423,6 +423,11 @@ function getTransactionMgr() {
* @param aListener (optional) the listener to call when complete.
*/
function doTransaction(aAction, aItem, aCalendar, aOldItem, aListener) {
// This is usually a user-initiated transaction, so make sure the calendar
// this transaction is happening on is visible.
ensureCalendarVisible(aCalendar);
// Now use the transaction manager to execute the action
getTransactionMgr().createAndCommitTxn(aAction,
aItem,
aCalendar,

Просмотреть файл

@ -213,6 +213,16 @@ function calendarListSetupContextMenu(event) {
return true;
}
/**
* Makes sure the passed calendar is visible to the user
*
* @param aCalendar The calendar to make visible.
*/
function ensureCalendarVisible(aCalendar) {
// We use the main window's calendar list to ensure that the calendar is visible
document.getElementById("calendar-list-tree-widget").ensureCalendarVisible(aCalendar);
}
var compositeObserver = {
QueryInterface: function cO_QueryInterface(aIID) {
return cal.doQueryInterface(this,

Просмотреть файл

@ -66,6 +66,7 @@ var calendarViewController = {
createNewEvent: function (aCalendar, aStartTime, aEndTime, aForceAllday) {
aCalendar = aCalendar || getSelectedCalendar();
// if we're given both times, skip the dialog
if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {
let item = cal.createEvent();