dnd: Centralize drag actor positioning code, use shellWorkspaceLaunch for workspaces

We had multiple copies of the code to position a drag actor given a particular
source.  Instead, just put it inside dnd.js.

Second, rather than test for GenericDisplay/WellDisplayItem etc.,
in various places, add a new method on each source "shellWorkspaceLaunch"
which both marks the item as being droppable on a workspace, and is
called by the workspaces code to launch the item.
This commit is contained in:
Colin Walters
2009-08-17 20:29:54 -04:00
parent 9563515e97
commit dd1a309cb6
5 changed files with 33 additions and 37 deletions

View File

@ -83,9 +83,15 @@ DocDisplayItem.prototype = {
}
},
//// Drag and Drop ////
shellWorkspaceLaunch: function() {
this.launch();
},
//// Private Methods ////
// Updates the last visited time displayed in the description text for the item.
// Updates the last visited time displayed in the description text for the item.
_resetTimeDisplay: function(currentSecs) {
let lastSecs = this._docInfo.timestamp;
let timeDelta = currentSecs - lastSecs;