Skip to content
Browse files

0.0.4 - optional data-id

  • Loading branch information...
1 parent 4d814d8 commit b4af46c015c409fccd504d4b43fd301d1aa0511e @maxogden committed Jan 31, 2013
Showing with 8 additions and 7 deletions.
  1. +5 −5 demo/index.html
  2. +2 −1 index.js
  3. +1 −1 package.json
View
10 demo/index.html
@@ -29,23 +29,23 @@
<ul class="tab-inner">
<li class="tab-item active">
<img class="tab-icon" src="icons/coffeemug.png">
- <div class="tab-label">Mug</div>
+ <div class="tab-label" data-id="mug">Mug</div>
</li>
<li class="tab-item">
<img class="tab-icon" src="icons/cow.png">
- <div class="tab-label">Cow</div>
+ <div class="tab-label" data-id="cow">Cow</div>
</li>
<li class="tab-item">
<img class="tab-icon" src="icons/eggs.png">
- <div class="tab-label">Eggs</div>
+ <div class="tab-label" data-id="eggs">Eggs</div>
</li>
<li class="tab-item">
<img class="tab-icon" src="icons/poptart.png">
- <div class="tab-label">Poptart</div>
+ <div class="tab-label" data-id="poptart">Poptart</div>
</li>
<li class="tab-item">
<img class="tab-icon" src="icons/toast.png">
- <div class="tab-label">Toast</div>
+ <div class="tab-label" data-id="toast">Toast</div>
</li>
</ul>
</nav>
View
3 index.js
@@ -177,5 +177,6 @@ HUD.prototype.switchToolbar = function(num) {
this.addClass(selected, 'active')
var active = this.el.querySelector('.active .tab-label')
if (!active) return
- this.emit('select', active.innerText)
+ var dataID = active.getAttribute('data-id')
+ this.emit('select', dataID ? dataID : active.innerText)
}
View
2 package.json
@@ -3,7 +3,7 @@
"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.3",
+ "version": "0.0.4",
"dependencies": {
"inherits": "1.0.0"
}

0 comments on commit b4af46c

Please sign in to comment.
Something went wrong with that request. Please try again.