Skip to content

Commit

Permalink
add bower.json, more/better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Hug committed May 26, 2015
1 parent 3d8763c commit 6f75a21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DOM-Builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// http://jsbin.com/DOMBuilder/2/edit
// https://github.com/Daniel-Hug/DOM-Builder
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -31,7 +31,11 @@
else if (attr.slice(0, 3) === 'on_') {
var eventName = attr.slice(3);
var handlers = nodeData[attr];

// accept a function:
if (typeof handlers === 'function') handlers = [handlers];

// or an array of functions:
for (var i = 0; i < handlers.length; i++) el.addEventListener(eventName, handlers[i], false);
}

Expand Down
13 changes: 13 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "DOM-Builder",
"version": "0.0.0",
"homepage": "https://github.com/Daniel-Hug/DOM-Builder",
"authors": [
"Daniel Hug"
],
"main": "DOM-Builder.js",
"moduleType": [
"amd",
"globals"
]
}

0 comments on commit 6f75a21

Please sign in to comment.