1.0.8 • Published 8 years ago

techknow-dominator v1.0.8

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

This file contains both the Helpers and Dominator classes within the Techknow namespace.

v 1.0.7 updates: fixed a bug that prevented multiple instances from being displayed on the page

Basic Usage:

var domElement = new Techknow.Dominator({
	insert: {
		into: 'body',
		//before: '.content',
		//after: '.header',
		//atTheStartOf: 'body',
		//atTheEndOf: 'body',
	},
	structure: [{
		tag: 'article',
		attr: {
			class: 'myNewArticleElementClassName otherClassName'
		},
		listeners: {
			event: 'click', // jquery event
			data: this, // item to be passed into callback as e.data
			target: '.childElementForDelegation', // sets the scope of 'this' in the callback
			action: function(e) {
				console.log('Running most awesome code here');
			},
		},
		children: [{
			tag: 'div',
			children: [{
				tag: 'span',
				text: 'My Awesome Article Div Span Text!',
				attr: {
					'data-span-prop': 'some data on the data-span-prop property',
				}
			}],
		}]
	}],
});
domElement.render(); //inserts element into page at insertion point
// domElement.buildNode(); //returns a javascript dom node representation without inserting into the dom
1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago