Skip to content

Commit

Permalink
Merge pull request #60 from yohanboniface/no_buttons
Browse files Browse the repository at this point in the history
Sanity check of buttons length before calling indexes
  • Loading branch information
jacobtoye committed Jan 17, 2013
2 parents 4c99b3e + 235f893 commit 238f0e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/draw/Control.Draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ L.Control.Draw = L.Control.extend({
this.handlers.marker.on('activated', this._disableInactiveModes, this);
}

// Add in the top and bottom classes so we get the border radius
L.DomUtil.addClass(buttons[0], partName + '-top');
L.DomUtil.addClass(buttons[buttons.length - 1], partName + '-bottom');
if (buttons.length) {
// Add in the top and bottom classes so we get the border radius
L.DomUtil.addClass(buttons[0], partName + '-top');
L.DomUtil.addClass(buttons[buttons.length - 1], partName + '-bottom');
}

return container;
},
Expand Down

0 comments on commit 238f0e0

Please sign in to comment.