Permalink
Browse files

updating to latest versions of component/dom

  • Loading branch information...
1 parent c44d4e4 commit 38e868a8ad2fe4a670f88d6ff20c426f67cc7f9b Dominic Barnes committed Jan 21, 2014
Showing with 7 additions and 9 deletions.
  1. +7 −9 index.js
View
@@ -31,7 +31,7 @@ function Menu() {
Emitter.call(this);
this.items = {};
this.menu = dom('<ul class=menu>').css('display','none');
- this.el = this.menu.get(0);
+ this.el = this.menu[0];
document.body.appendChild(this.el);
this.menu.on('hover', this.deselect.bind(this));
document.getElementsByTagName('html')[0].onclick = this.hide.bind(this);
@@ -91,7 +91,7 @@ Menu.prototype.onkeydown = function(e){
break;
// up
case 38:
- e.preventDefault();
+ e.preventDefault();
e.stopImmediatePropagation();
this.move('previous');
break;
@@ -115,14 +115,14 @@ Menu.prototype.move = function(direction){
var prev = this.menu.find('.selected');
var next = prev.length()
- ? prev.get(0)[direction + 'ElementSibling']
- : this.menu.find('li:first-child').get(0);
+ ? prev[0][direction + 'ElementSibling']
+ : this.menu.find('li:first-child')[0];
next = next ? dom(next) : dom([]);
if (next.length()) {
prev.removeClass('selected');
next.addClass('selected');
- next.find('a').get(0).focus();
+ next.find('a')[0].focus();
}
};
@@ -166,8 +166,8 @@ Menu.prototype.add = function(text, fn){
fn && fn();
});
- this.el.appendChild(el.get(0));
- this.items[slug] = el.get(0);
+ this.el.appendChild(el[0]);
+ this.items[slug] = el[0];
return this;
};
@@ -255,5 +255,3 @@ function createSlug(str) {
.replace(/ +/g, '-')
.replace(/[^a-z0-9-]/g, '');
}
-
-

0 comments on commit 38e868a

Please sign in to comment.