fix for bug #386788: DnD of multiple items of multiple types only drops part of selection patch=Christine Yen <christineyen+bugs@gmail.com> r=sspitzer

This commit is contained in:
sspitzer@mozilla.org 2007-08-02 23:10:00 -07:00
Родитель 99413b399d
Коммит a15dcf6e6a
1 изменённых файлов: 13 добавлений и 24 удалений

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

@ -1165,7 +1165,8 @@ PlacesController.prototype = {
var data = new TransferData(); var data = new TransferData();
function addData(type, overrideURI) { function addData(type, overrideURI) {
data.addDataForFlavour(type, PlacesUtils._wrapString(PlacesUtils.wrapNode(node, type, overrideURI))); data.addDataForFlavour(type, PlacesUtils._wrapString(
PlacesUtils.wrapNode(node, type, overrideURI)));
} }
function addURIData(overrideURI) { function addURIData(overrideURI) {
@ -1174,29 +1175,17 @@ PlacesController.prototype = {
addData(PlacesUtils.TYPE_HTML, overrideURI); addData(PlacesUtils.TYPE_HTML, overrideURI);
} }
if (PlacesUtils.nodeIsFolder(node) || PlacesUtils.nodeIsQuery(node)) { // This order is _important_! It controls how this and other
// Look up this node's place: URI in the annotation service to see if // applications select data to be inserted based on type.
// it is a special, non-movable folder. addData(PlacesUtils.TYPE_X_MOZ_PLACE);
// XXXben: TODO
var uri;
addData(PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER);
// Allow dropping the feed uri of live-bookmark folders
// Allow dropping the feed uri of live-bookmark folders if (PlacesUtils.nodeIsLivemarkContainer(node))
if (PlacesUtils.nodeIsLivemarkContainer(node)) { uri = PlacesUtils.livemarks.getFeedURI(node.itemId).spec;
var uri = PlacesUtils.livemarks.getFeedURI(node.itemId);
addURIData(uri.spec); addURIData(uri);
}
}
else if (PlacesUtils.nodeIsSeparator(node)) {
addData(PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR);
}
else {
// This order is _important_! It controls how this and other
// applications select data to be inserted based on type.
addData(PlacesUtils.TYPE_X_MOZ_PLACE);
addURIData();
}
dataSet.push(data); dataSet.push(data);
} }
return dataSet; return dataSet;