diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index b980460b7..ab06c3549 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -404,7 +404,8 @@ AppWellIcon.prototype = { this.actor.connect('clicked', Lang.bind(this, this._onClicked)); this._menu = null; - this._draggable = DND.makeDraggable(this.actor, true); + this._draggable = DND.makeDraggable(this.actor, + { manualMode: true }); this._dragStartX = null; this._dragStartY = null; diff --git a/js/ui/dnd.js b/js/ui/dnd.js index bfd30104d..f64dc7513 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -6,6 +6,8 @@ const Lang = imports.lang; const Signals = imports.signals; const Tweener = imports.ui.tweener; +const Params = imports.misc.params; + const SNAP_BACK_ANIMATION_TIME = 0.25; let eventHandlerActor = null; @@ -27,14 +29,16 @@ function _getEventHandlerActor() { return eventHandlerActor; } -function _Draggable(actor, manualMode) { - this._init(actor, manualMode); +function _Draggable(actor, params) { + this._init(actor, params); } _Draggable.prototype = { - _init : function(actor, manualMode) { + _init : function(actor, params) { + params = Params.parse(params, { manualMode: false }); + this.actor = actor; - if (!manualMode) + if (!params.manualMode) this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); @@ -328,10 +332,13 @@ Signals.addSignalMethods(_Draggable.prototype); /** * makeDraggable: * @actor: Source actor - * @manualMode: If given, do not automatically start drag and drop on click + * @params: (optional) Additional parameters * * Create an object which controls drag and drop for the given actor. + * + * If %manualMode is %true in @params, do not automatically start + * drag and drop on click */ -function makeDraggable(actor, manualMode) { - return new _Draggable(actor, manualMode); +function makeDraggable(actor, params) { + return new _Draggable(actor, params); } diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index a7a35d18e..99aecec48 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -445,7 +445,8 @@ DashPlaceDisplayItem.prototype = { this.actor._delegate = this; this._dragStartX = null; this._dragStartY = null; - this._draggable = DND.makeDraggable(this.actor, true); + this._draggable = DND.makeDraggable(this.actor, + { manualMode: true }); }, _onClicked: function(b) {