Permalink
Browse files

Merge pull request #23 from lauramelos/master

Change the Inherit method and fix not multiple select event
  • Loading branch information...
2 parents 144d217 + 2b3819d commit a24730e01d2395002c020f9e5b6b400e5c6c807d @retrofox retrofox committed Jan 31, 2013
Showing with 9 additions and 4 deletions.
  1. +1 −0 component.json
  2. +6 −3 index.js
  3. +2 −1 package.json
View
@@ -12,6 +12,7 @@
"dependencies": {
"component/jquery": "*",
"component/classes": "*",
+ "component/inherit": "*",
"component/menu": "*"
},
"styles": [
View
@@ -4,6 +4,7 @@
var Menu = require('menu')
, classes = require('classes')
+ , inherit = require('inherit')
, o = require('jquery');
/**
@@ -70,7 +71,7 @@ function Dropdown(ref, opts) {
* Inherits from `Menu.prototype`.
*/
-Dropdown.prototype.__proto__ = Menu.prototype;
+inherit(Dropdown, Menu);
/**
* Add click event to reference element
@@ -134,8 +135,10 @@ Dropdown.prototype.focus = function(slug){
this.ref[mtd](selected.find('a').html());
this.emit('focus', slug);
}
- this.checked.push(slug);
- this.emit('check', slug, this.checked);
+ if (multi) {
+ this.checked.push(slug);
+ this.emit('check', slug, this.checked);
+ }
}
css_selected.add('current');
View
@@ -9,7 +9,8 @@
"component"
],
"dependencies": {
- "menu-component": "*"
+ "menu-component": "*",
+ "inherit-component": "*"
},
"component": {
"styles": [

0 comments on commit a24730e

Please sign in to comment.