From 7f0eb1b8db61a15b6c2c43d0e9274d61a94ff13b Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 15 May 2012 18:27:21 +0000 Subject: [PATCH] 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 --- UI/WebServerResources/ContactsUI.js | 38 ++++++++++++++--------------- UI/WebServerResources/MailerUI.js | 32 ++++++++++++------------ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 12250965c..6a14b5678 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -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(); diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index be49e0ee7..3422fee67 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -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); }