Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change the Inherit method and fix not multiple select event #23

Merged
merged 3 commits into from

2 participants

@lauramelos

Change the Inherit method from proto to inherit component
Fix a not multiple Dropdown select event bug.

@retrofox retrofox merged commit a24730e into component:master
@retrofox
Owner
@lauramelos

you're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 4 deletions.
  1. +1 −0  component.json
  2. +6 −3 index.js
  3. +2 −1  package.json
View
1  component.json
@@ -12,6 +12,7 @@
"dependencies": {
"component/jquery": "*",
"component/classes": "*",
+ "component/inherit": "*",
"component/menu": "*"
},
"styles": [
View
9 index.js
@@ -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
3  package.json
@@ -9,7 +9,8 @@
"component"
],
"dependencies": {
- "menu-component": "*"
+ "menu-component": "*",
+ "inherit-component": "*"
},
"component": {
"styles": [
Something went wrong with that request. Please try again.