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
Родитель ced08c0d12
Коммит 2179add01d
3 изменённых файлов: 18 добавлений и 9 удалений

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

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

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

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

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

@ -128,7 +128,13 @@
<property name="browserWindow" onget="return window;"/> <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"> <method name="selectAll">
<body><![CDATA[ <body><![CDATA[