From 1c1bcf86ffc1df9524d988071096c9e4a02cf9c1 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 7 Jan 2011 22:28:25 +0000 Subject: [PATCH] Clarifying docs and removing a bit of lint. git-svn-id: http://svn.openlayers.org/trunk/openlayers@11020 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Box.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/OpenLayers/Handler/Box.js b/lib/OpenLayers/Handler/Box.js index c530941ad9..a6cb1a84ab 100644 --- a/lib/OpenLayers/Handler/Box.js +++ b/lib/OpenLayers/Handler/Box.js @@ -43,22 +43,25 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, { * * Parameters: * control - {} - * callbacks - {Object} An object containing a single function to be - * called when the drag operation is finished. - * The callback should expect to recieve a single - * argument, the point geometry. + * callbacks - {Object} An object with a "done" property whose value is a + * callback to be called when the box drag operation is finished. + * The callback should expect to recieve a single argument, the box + * bounds or a pixel. If the box dragging didn't span more than a 5 + * pixel distance, a pixel will be returned instead of a bounds object. * options - {Object} */ initialize: function(control, callbacks, options) { OpenLayers.Handler.prototype.initialize.apply(this, arguments); - var callbacks = { - "down": this.startBox, - "move": this.moveBox, - "out": this.removeBox, - "up": this.endBox - }; this.dragHandler = new OpenLayers.Handler.Drag( - this, callbacks, {keyMask: this.keyMask}); + this, + { + down: this.startBox, + move: this.moveBox, + out: this.removeBox, + up: this.endBox + }, + {keyMask: this.keyMask} + ); }, /**