Bug 317435 - Add DnD hook to userlist tree to make dragging a user from it drag their nickname.

ChatZilla only.
r=silver
p=gijskruitbosch+bugs@gmail.com (Gijs Kruitbosch)
This commit is contained in:
silver%warwickcompsoc.co.uk 2005-12-28 21:48:33 +00:00
Родитель ac0a47b471
Коммит e2fb93af2c
1 изменённых файлов: 19 добавлений и 0 удалений

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

@ -279,6 +279,11 @@ function initStatic()
setListMode("symbol");
else
setListMode("graphic");
var tree = document.getElementById('user-list');
tree.setAttribute("ondraggesture",
"nsDragAndDrop.startDrag(event, userlistDNDObserver);");
setDebugMode(client.prefs["debugMode"]);
var ver = __cz_version + (__cz_suffix ? "-" + __cz_suffix : "");
@ -3223,6 +3228,20 @@ function tabdnd_dstart (aEvent, aXferData, aDragAction)
name + "</a>");
}
var userlistDNDObserver = new Object();
userlistDNDObserver.onDragStart =
function userlistdnd_dstart(event, transferdata, dragAction)
{
var tree = document.getElementById('user-list');
var index = tree.treeBoxObject.getRowAt(event.clientX, event.clientY);
var user = tree.contentView.getItemAtIndex(index).firstChild.firstChild;
var nickname = user.getAttribute("unicodeName");
transferdata.data = new TransferData();
transferdata.data.addDataForFlavour("text/unicode", nickname);
}
function deleteTab (tb)
{
if (!ASSERT(tb.hasAttribute("viewKey"),