Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to reflext component/menu changes

  • Loading branch information...
commit 7906e1b64cf941c3c424d48cc3d587e9f7c81b03 1 parent 35703ff
@charypar charypar authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 index.js
  2. +2 −2 test/index.html
View
4 index.js
@@ -113,7 +113,7 @@ Dropdown.prototype.focus = function(slug){
if (!selected) throw new Error('Doesn\'t exists `' + slug + '` item.');
var multi = this.options.multiple;
- var css_selected = classes(selected.get(0));
+ var css_selected = classes(selected);
var new_selection = !css_selected.has('current');
if (this.current) {
@@ -132,7 +132,7 @@ Dropdown.prototype.focus = function(slug){
if (new_selection) {
if (this.options.selectable) {
var mtd = 'input' == this.ref.get(0).tagName.toLowerCase() ? 'val' : 'html';
- this.ref[mtd](selected.find('a').html());
+ this.ref[mtd](o(selected).find('a').html());
this.emit('focus', slug);
}
if (multi) {
View
4 test/index.html
@@ -34,7 +34,7 @@
.option('selectable', false)
.option('menu', false)
.add('Add item', function(){ n++; dropdown.add('new ' + n + ' item'); })
- .add('Edit item', 'Edit <em>item</em>', function(){ console.log('edit'); })
+ .add('edit-item', 'Edit <em>item</em>', function(){ console.log('edit'); })
.add('Remove "Add item"', function(){ dropdown.remove('add-item'); })
.on('select', function(slug) { console.log(slug); })
@@ -104,4 +104,4 @@
</script>
</body>
-</html>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.