315940 - allow bookmarks to be dropped _into_ left list folders. NPOB

This commit is contained in:
beng%bengoodger.com 2005-11-28 00:36:21 +00:00
Родитель 7c85999f0c
Коммит c91d68bf55
3 изменённых файлов: 18 добавлений и 9 удалений

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

@ -855,14 +855,19 @@ var PlacesControllerDragHelper = {
* @param view
* An object implementing the AVI that supplies a list of
* supported droppable content types
* @param orientation
* The orientation of the drop
* @returns An object implementing nsITransferable that can receive data
* dropped onto a view.
*/
_initTransferable: function PCDH__initTransferable(view) {
_initTransferable: function PCDH__initTransferable(view, orientation) {
var xferable =
Cc["@mozilla.org/widget/transferable;1"].
createInstance(Ci.nsITransferable);
var types = view.supportedDropTypes;
if (orientation != Ci.nsINavHistoryResultViewObserver.DROP_ON)
var types = view.supportedDropTypes;
else
types = view.supportedDropOnTypes;
for (var j = 0; j < types.length; ++j)
xferable.addDataFlavor(types[j]);
return xferable;
@ -876,6 +881,8 @@ var PlacesControllerDragHelper = {
* The container the drop was into
* @param index
* The index within the container the item was dropped at
* @param orientation
* The orientation of the drop
*/
onDrop: function PCDH_onDrop(view, container, index) {
var session = this._getSession();
@ -884,7 +891,7 @@ var PlacesControllerDragHelper = {
var copy = session.dragAction & Ci.nsIDragService.DRAGDROP_ACTION_COPY;
var transactions = [];
var xferable = this._initTransferable(view);
var xferable = this._initTransferable(view, orientation);
for (var i = 0; i < session.numDropItems; ++i) {
session.getData(xferable, i);

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

@ -364,10 +364,6 @@
dragSession.canDrop = true;
},
onDrop: function(event, xferData, dragSession) {
},
_flavorSet: null,
getSupportedFlavours: function() {
if (!this._flavorSet) {
@ -413,7 +409,7 @@
destContainer = node.parent.folderId;
}
PlacesControllerDragHelper.onDrop(this._self, destContainer,
destIndex);
destIndex, orientation);
},
// XXXben we will probably have to implement this to refresh Live

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

@ -128,7 +128,13 @@
<property name="browserWindow" onget="return window;"/>
<field name="supportedDropTypes">["text/x-moz-place", "text/x-moz-url"]</field>
<field name="supportedDropTypes">
[TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL]
</field>
<field name="supportedDropOnTypes">
[TYPE_X_MOZ_PLACE_CONTAINER, TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL]
</field>
<method name="selectAll">
<body><![CDATA[