merge of '065f29d26993d0476f752244bc9a97e2e8c8dcaa'

and '198c312f6f50dd9e647df21a626b63d5737a368b'

Monotone-Parent: 065f29d26993d0476f752244bc9a97e2e8c8dcaa
Monotone-Parent: 198c312f6f50dd9e647df21a626b63d5737a368b
Monotone-Revision: 310656e43745cf03a754d629917e6024ec566244

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-07-01T20:09:38
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert 2009-07-01 20:09:38 +00:00
commit 0da799fd8c
3 changed files with 17 additions and 1 deletions

View file

@ -603,6 +603,7 @@ function appendAddressBook(name, folder) {
.replace(">", ">", "g"))); .replace(">", ">", "g")));
setEventsOnAddressBook(li); setEventsOnAddressBook(li);
updateAddressBooksMenus(); updateAddressBooksMenus();
configureDragAndDrop ();
} }
return result; return result;
@ -1066,6 +1067,8 @@ function initContacts(event) {
} }
function configureDragAndDrop () { function configureDragAndDrop () {
Droppables.empty ();
Draggables.empty ();
var mainElement = new Element ("div", {id: "dragDropVisual"}); var mainElement = new Element ("div", {id: "dragDropVisual"});
document.body.appendChild(mainElement); document.body.appendChild(mainElement);
mainElement.absolutize (); mainElement.absolutize ();

View file

@ -660,8 +660,8 @@ function messageListCallback(http) {
table = $('messageList'); table = $('messageList');
configureMessageListEvents(table); configureMessageListEvents(table);
TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
setTimeout ('configureDragAndDrop ();', 500);
} }
configureDragAndDrop ();
configureMessageListBodyEvents(table); configureMessageListBodyEvents(table);
var selected = http.callbackData; var selected = http.callbackData;
@ -1756,6 +1756,7 @@ function onLoadMailboxesCallback(http) {
checkAjaxRequestsState(); checkAjaxRequestsState();
getFoldersState(); getFoldersState();
updateStatusFolders(); updateStatusFolders();
configureDragAndDrop ();
} }
} }
else else
@ -2231,6 +2232,9 @@ Mailbox.prototype = {
function configureDragAndDrop () { function configureDragAndDrop () {
Droppables.empty ();
Draggables.empty ();
var mainElement = new Element ("div", {id: "dragDropVisual"}); var mainElement = new Element ("div", {id: "dragDropVisual"});
document.body.appendChild(mainElement); document.body.appendChild(mainElement);
mainElement.absolutize (); mainElement.absolutize ();

View file

@ -12,6 +12,10 @@ if(Object.isUndefined(Effect))
var Droppables = { var Droppables = {
drops: [], drops: [],
empty: function () {
this.drops = [];
},
remove: function(element) { remove: function(element) {
this.drops = this.drops.reject(function(d) { return d.element==$(element) }); this.drops = this.drops.reject(function(d) { return d.element==$(element) });
}, },
@ -129,6 +133,11 @@ var Draggables = {
drags: [], drags: [],
observers: [], observers: [],
empty: function () {
this.drags = [];
this.observers = [];
},
register: function(draggable) { register: function(draggable) {
if(this.drags.length == 0) { if(this.drags.length == 0) {
this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseUp = this.endDrag.bindAsEventListener(this);