Skip to content

Commit

Permalink
Allow constructor to be invoked without new
Browse files Browse the repository at this point in the history
  • Loading branch information
colinf committed Sep 9, 2012
1 parent 5be0ede commit 7131fba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -27,6 +27,7 @@ module.exports = ListboxMenu;
*/

function ListboxMenu() {
if (!(this instanceof ListboxMenu)) return new ListboxMenu;
Menu.call(this);
this.el.addClass('listbox-menu');
this.el.hover(this.deselect.bind(this));
Expand Down

0 comments on commit 7131fba

Please sign in to comment.