зеркало из https://github.com/mozilla/pjs.git
315940 - allow bookmarks to be dropped _into_ left list folders. NPOB
This commit is contained in:
Родитель
7c85999f0c
Коммит
c91d68bf55
|
@ -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[
|
||||
|
|
Загрузка…
Ссылка в новой задаче