Fixed calls to jQuery objects in DnD of messages and cards.

Monotone-Parent: 9c94aa2e20e881730ce518cc53bea638ece87f37
Monotone-Revision: e4c701f2293beb98253d68bb64b7fa0133b1dda5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2012-05-15T18:27:21
maint-2.0.2
Francis Lachapelle 2012-05-15 18:27:21 +00:00
parent 5e6d52be6a
commit 7f0eb1b8db
2 changed files with 35 additions and 35 deletions

View File

@ -1509,45 +1509,45 @@ function currentFolderIsRemote() {
return rc;
}
function startDragging(e, itm) {
var row = e.target;
var handle = $("dragDropVisual");
function startDragging(event, ui) {
var row = event.target;
var handle = ui.helper;
var contacts = $('contactsList').getSelectedRowsId();
var count = contacts.length;
if (count == 0 || contacts.indexOf(row.id) < 0) {
onRowClick(e, $(row.id));
onRowClick(event, $(row.id));
contacts = $("contactsList").getSelectedRowsId();
count = contacts.length;
}
handle.update(count);
handle.html(count);
if (e.shiftKey || currentFolderIsRemote()) {
handle.addClassName("copy");
if (event.shiftKey || currentFolderIsRemote()) {
handle.addClass("copy");
}
handle.show();
}
function whileDragging(e, itm) {
if (e) {
var handle = $("dragDropVisual");
if (e.shiftKey || currentFolderIsRemote())
handle.addClassName ("copy");
else if (handle.hasClassName ("copy"))
handle.removeClassName ("copy");
function whileDragging(event, ui) {
if (event) {
var handle = ui.helper;
if (event.shiftKey || currentFolderIsRemote())
handle.addClass("copy");
else if (handle.hasClass("copy"))
handle.removeClass("copy");
}
}
function stopDragging(e, itm) {
var handle = $("dragDropVisual");
function stopDragging(event, ui) {
var handle = ui.helper;
handle.hide();
if (handle.hasClassName("copy"))
handle.removeClassName("copy");
if (handle.hasClass("copy"))
handle.removeClass("copy");
}
function dropAction(event, ui) {
var action = "move";
if ($("dragDropVisual").hasClassName("copy"))
if (ui.helper.hasClass("copy"))
action = "copy";
else
$('contactView').update();

View File

@ -2932,7 +2932,7 @@ function configureDroppables() {
drop: dropAction });
}
function startDragging(e, ui) {
function startDragging(event, ui) {
var handle = ui.helper;
var count = $('messageListBody').getSelectedRowsId().length;
@ -2942,29 +2942,29 @@ function startDragging(e, ui) {
}
handle.html(count);
if (e.shiftKey) {
handle.addClassName("copy");
if (event.shiftKey) {
handle.addClass("copy");
}
handle.show();
}
function whileDragging(e, ui) {
if (e) {
var handle = $("dragDropVisual");
if (e.shiftKey)
handle.addClassName("copy");
else if (handle.hasClassName("copy"))
handle.removeClassName("copy");
function whileDragging(event, ui) {
if (event) {
var handle = ui.helper;
if (event.shiftKey)
handle.addClass("copy");
else if (handle.hasClass("copy"))
handle.removeClass("copy");
}
}
function stopDragging() {
var handle = $("dragDropVisual");
function stopDragging(event, ui) {
var handle = ui.helper;
handle.hide();
if (handle.hasClassName("copy"))
handle.removeClassName("copy");
if (handle.hasClass("copy"))
handle.removeClass("copy");
for (var i = 0; i < accounts.length; i++) {
handle.removeClassName("account" + i);
handle.removeClass("account" + i);
}
}
@ -2975,7 +2975,7 @@ function dropAction(event, ui) {
var destAct = destination.getAttribute("dataname").split("/")[1];
if (sourceAct == destAct) {
var f;
if ($("dragDropVisual").hasClassName("copy")) {
if (ui.helper.hasClass("copy")) {
// Message(s) copied
f = onMailboxMenuCopy.bind(destination);
}