jacobtoye/Leaflet.draw — pull request #24 by inpursuit (2012-10-04 14:05:38+00:00)
Title: Fixed issue when user single clicks without dragging after a SimpleShape draw handler is installed in the view

If a SimpleShape draw handler is installed in the map and the user single clicks without dragging then the following exception is thrown: Uncaught TypeError: 'Cannot call method 'getRadius' of undefined' by the _fireCreatedEvent method of Circle and Rectangle. The _fireCreatedEvent method creates a new Leaflet shape using the _shape variable created in the _drawShape method but the _drawShape method is only called when the mouse is moved.
You could create a shape with no area if the mouse is not moved after clicking but I thought it made more sense to just not fire the created event if the mouse is single clicked.
Also moved the update to the label text into _onMouseMove so that the label text doesn't change if the user single clicks on the map.