Fix focus of popup windows with FF on Windows

This commit is contained in:
Francis Lachapelle
2014-05-12 15:25:50 -04:00
parent 698524b39f
commit 5c41915080
4 changed files with 68 additions and 48 deletions
+4 -2
View File
@@ -323,8 +323,10 @@ function onMenuRawContact (event) {
return row.readAttribute("id");
});
openGenericWindow(URLForFolderID(Contact.currentAddressBook)
+ "/" + cname + "/raw");
$(function() {
openGenericWindow(URLForFolderID(Contact.currentAddressBook)
+ "/" + cname + "/raw");
}).delay(0.1);
}
function actionContactCallback(http) {
+3 -3
View File
@@ -1045,8 +1045,6 @@ function onMessageContextMenu(event) {
popupMenu(event, "messagesListMenu", selectedNodes);
else if (selectedNodes.length == 1)
popupMenu(event, "messageListMenu", row);
return false;
}
function onFolderMenuClick(event) {
@@ -1726,7 +1724,9 @@ function onMenuViewMessageSource(event) {
if (rows.length > 0) {
var url = (ApplicationBaseURL + encodeURI(Mailer.currentMailbox) + "/"
+ rows[0].substr(4) + "/viewsource");
openMailComposeWindow(url);
$(function() {
openMailComposeWindow(url);
}).delay(0.1);
}
preventDefault(event);
+36 -20
View File
@@ -74,7 +74,7 @@ function newEventFromWidget(sender, type) {
var day = $(sender).readAttribute("day");
var hour = sender.readAttribute("hour");
return newEvent(type, day, hour);
newEvent.delay(0.1, type, day, hour);
}
function minutesToHM(minutes) {
@@ -156,16 +156,26 @@ function getSelectedFolder() {
function onMenuNewEventClick(event) {
var target = document.menuTarget;
if (/(minutes\d{2}|dayHeader)/.test(target.className))
target = target.parentNode;
newEventFromWidget(target, "event");
if (target) {
if (/(minutes\d{2}|dayHeader)/.test(target.className))
target = target.parentNode;
newEventFromWidget(target, "event");
}
else {
newEvent('event');
}
}
function onMenuNewTaskClick(event) {
var target = document.menuTarget;
if (/(minutes\d{2}|dayHeader)/.test(target.className))
target = target.parentNode;
newEventFromWidget(target, "task");
if (target) {
if (/(minutes\d{2}|dayHeader)/.test(target.className))
target = target.parentNode;
newEventFromWidget(target, "task");
}
else {
newEvent('task');
}
}
function _editEventId(id, calendar, recurrence) {
@@ -192,14 +202,18 @@ function editEvent() {
}
for (var i = 0; i < nodes.length; i++)
_editEventId(nodes[i].cname,
nodes[i].calendar);
_editEventId.delay(0.1,
nodes[i].cname,
nodes[i].calendar);
} else if (selectedCalendarCell) {
if (selectedCalendarCell[0].recurrenceTime && !selectedCalendarCell[0].isException)
_editRecurrenceDialog(selectedCalendarCell[0], "confirmEditing");
_editRecurrenceDialog.delay(0.1,
selectedCalendarCell[0],
"confirmEditing");
else
_editEventId(selectedCalendarCell[0].cname,
selectedCalendarCell[0].calendar);
_editEventId.delay(0.1,
selectedCalendarCell[0].cname,
selectedCalendarCell[0].calendar);
} else {
showAlertDialog(_("Please select an event or a task."));
}
@@ -470,7 +484,7 @@ function onMenuRawEvent(event) {
var cname = selectedCalendarCell[0].cname;
var url = ApplicationBaseURL + "/" + calendar + "/" + cname + "/raw";
openGenericWindow(url);
openGenericWindow.delay(0.1, url);
}
function modifyEvent(sender, modification, parameters) {
@@ -2747,8 +2761,8 @@ function getMenus() {
dateMenu.push(onYearMenuItemClick);
menus["yearListMenu"] = dateMenu;
menus["eventsListMenu"] = new Array(onMenuNewEventClick, "-",
onMenuNewTaskClick,
menus["eventsListMenu"] = new Array(onMenuNewEventClick,
onMenuNewTaskClick, "-",
editEvent, deleteEvent, "-",
onSelectAll, "-",
null, null);
@@ -2776,7 +2790,7 @@ function getMenus() {
}
function newTask () {
return newEventFromWidget(this, 'task');
newEventFromWidget.delay(0.1, this, 'task');
}
function marksTasksAsCompleted () {
@@ -2804,7 +2818,7 @@ function onMenuRawTask(event) {
}
var url = ApplicationBaseURL + "/" + selectedTasks[0].calendar + "/" + selectedTasks[0].cname + "/raw"
openGenericWindow(url);
openGenericWindow.delay(0.1, url);
}
@@ -2920,9 +2934,11 @@ function onCalendarModify(event) {
height -= 26;
}
var properties = window.open(url, windowID,
"width="+width+",height="+height+",resizable=0");
properties.focus();
$(function() {
var properties = window.open(url, windowID,
"width="+width+",height="+height+",resizable=0");
properties.focus();
}).delay(0.1);
}
function updateCalendarProperties(calendarID, calendarName, calendarColor) {
+25 -23
View File
@@ -264,11 +264,11 @@ function openContactWindow(url, wId) {
else
wId = sanitizeWindowName(wId);
var w = window.open(url, wId,
"width=460,height=560,resizable=0,location=0");
w.focus();
return w;
$(function() {
var w = window.open(url, wId,
"width=460,height=560,resizable=0,location=0");
w.focus();
}).delay(0.1);
}
}
@@ -325,9 +325,11 @@ function openMailTo(senderMailTo) {
}
if (sanitizedAddresses.length > 0)
openMailComposeWindow(ApplicationBaseURL
+ "/../Mail/compose?mailto=" + encodeURIComponent(Object.toJSON(sanitizedAddresses))
+ ((subject.length > 0)?"?subject=" + encodeURIComponent(subject):""));
$(function() {
openMailComposeWindow(ApplicationBaseURL
+ "/../Mail/compose?mailto=" + encodeURIComponent(Object.toJSON(sanitizedAddresses))
+ ((subject.length > 0)?"?subject=" + encodeURIComponent(subject):""));
}).delay(0.1);
return false; /* stop following the link */
}
@@ -848,13 +850,13 @@ function hideMenu(menuNode) {
Event.fire(menuNode, "contextmenu:hide");
}
function onMenuEntryClick(event) {
var node = event.target;
id = getParentMenu(node).menuTarget;
return false;
}
//function onMenuEntryClick(event) {
// var node = event.target;
//
// id = getParentMenu(node).menuTarget;
//
// return false;
//}
/* query string */
@@ -1543,14 +1545,14 @@ function openExternalLink(anchor) {
}
function openAclWindow(url) {
var w = window.open(url, "aclWindow",
"width=420,height=300,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
w.opener = window;
w.focus();
return w;
$(function () {
var w = window.open(url, "aclWindow",
"width=420,height=300,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
w.opener = window;
w.focus();
}).delay(0.1);
}
function getUsersRightsWindowHeight() {