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

This commit is contained in:
beng%bengoodger.com 2005-11-28 00:33:37 +00:00
parent 584663989a
commit ced08c0d12
4 changed files with 23 additions and 5 deletions

View File

@ -789,13 +789,19 @@ var PlacesControllerDragHelper = {
* on the specified view.
* @param view
* An object implementing the AVI
* @param orientation
* The orientation of the drop
* XXXben implement index param!
* @returns true if the data being dragged is of a type supported by the view
* it is being dragged over, false otherwise.
*/
canDrop: function PCDH_canDrop(view) {
canDrop: function PCDH_canDrop(view, orientation) {
var session = this._getSession();
if (session) {
var types = view.supportedDropTypes;
if (orientation != Ci.nsINavHistoryResultViewObserver.DROP_ON)
var types = view.supportedDropTypes;
else
types = view.supportedDropOnTypes;
for (var i = 0; i < types.length; ++i) {
if (session.isDataFlavorSupported(types[i]))
return true;

View File

@ -137,7 +137,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[

View File

@ -107,8 +107,11 @@ var PlacesPage = {
this._content.controllers.appendController(PlacesController);
this._places.supportedDropTypes = [TYPE_X_MOZ_PLACE_CONTAINER];
this._places.supportedDropOnTypes = [TYPE_X_MOZ_PLACE_CONTAINER,
TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL];
this._content.supportedDropTypes = [TYPE_X_MOZ_PLACE_CONTAINER,
TYPE_X_MOZ_PLACE, TYPE_X_MOZ_URL];
this._content.supportedDropOnTypes = this._content.supportedDropTypes;
// Hook the browser UI
PlacesUIHook.init(this._content);

View File

@ -297,6 +297,9 @@
<!-- AVI Method -->
<field name="supportedDropTypes">null</field>
<!-- AVI Method -->
<field name="supportedDropOnTypes">null</field>
<!-- AVI Method -->
<method name="selectAll">
<body><![CDATA[
@ -380,8 +383,8 @@
({
_self: this,
canDrop: function VO_canDrop() {
return PlacesControllerDragHelper.canDrop(this._self);
canDrop: function VO_canDrop(index, orientation) {
return PlacesControllerDragHelper.canDrop(this._self, orientation);
},
onDrop: function VO_onDrop(index, orientation) {