Permalink
Browse files

0.0.5 - use element-class

  • Loading branch information...
1 parent b4af46c commit 3860cb1f3c6ca0ff57a9bf9dd9c6f35a7107f14f @maxogden committed Feb 8, 2013
Showing with 6 additions and 13 deletions.
  1. +3 −11 index.js
  2. +3 −2 package.json
View
@@ -1,6 +1,7 @@
var keymaster = require('./lib/keymaster.js')
var inherits = require('inherits')
var events = require('events')
+var elementClass = require('element-class')
var keyTable =
{ 8 : 'backspace'
@@ -146,21 +147,12 @@ HUD.prototype.onItemClick = function(ev) {
HUD.prototype.addClass = function(el, className) {
if (!el) return
- if (el.className === "") return el.className = className
- var classes = el.className.split(' ')
- classes.push(className)
- el.className = classes.join(' ')
- return classes
+ return elementClass(el).add(className)
}
HUD.prototype.removeClass = function(el, className) {
if (!el) return
- if (el.className === "") return
- var classes = el.className.split(' ')
- var idx = classes.indexOf(className)
- if (idx > -1) classes.splice(idx, 1)
- el.className = classes.join(' ')
- return classes
+ return elementClass(el).remove(className)
}
HUD.prototype.toolbarIndexOf = function(li) {
View
@@ -3,8 +3,9 @@
"description": "client side module for creating toolbars",
"author": {"name": "Max Ogden", "email": "max@maxogden.com"},
"repository": {"type": "git", "url": "git@github.com:maxogden/toolbar.git"},
- "version": "0.0.4",
+ "version": "0.0.5",
"dependencies": {
- "inherits": "1.0.0"
+ "inherits": "1.0.0",
+ "element-class": "0.0.2"
}
}

0 comments on commit 3860cb1

Please sign in to comment.