@marcomontalbano marcomontalbano released this Jan 22, 2018 · 3 commits to master since this release

Assets 2

Added support for jQuery v3.3.x

@marcomontalbano marcomontalbano released this Nov 23, 2017 · 5 commits to master since this release

Assets 2

Updated dependencies

@marcomontalbano marcomontalbano released this Jul 15, 2017 · 13 commits to master since this release

Assets 2

jCreate now pass data to the handler in event.data when the event is triggered.

http://api.jquery.com/on/#passing-data

@marcomontalbano marcomontalbano released this Jun 30, 2017 · 15 commits to master since this release

Assets 2

Development upgrade

  • added pre-commit hook to build the project before commit
  • adde setup instruction for yarn
  • refactored unit tests
  • updated grunt-contrib-uglify to v3.x
  • updated README.md with npm package
  • replaced webserver.js project with http-server
  • removed grunt-contrib-copy

@marcomontalbano marcomontalbano released this Jun 27, 2017 · 21 commits to master since this release

Assets 2

Added jquery-jcreate to npm registry

@marcomontalbano marcomontalbano released this Jun 27, 2017

Assets 2

Added support for npm, Yarn, UMD.

Yarn and npm

You can install jCreate using Yarn or npm:

# yarn
yarn add jquery-jcreate

# npm
npm install --save jquery-jcreate

Webpack 2

import $ from 'jquery';
import 'jquery-jcreate';

$(document).on('create', '*', function(event) {
    console.log( 'created tag: ', event.$currentTarget.prop('tagName') );
});

RequireJS

define(["jquery", "jquery-jcreate"], function( $ ) {

    $(document).on('create', '*', function(event) {
        console.log( 'created tag: ', event.$currentTarget.prop('tagName') );
    });
});

Bower

You can install jCreate using Bower:

bower install --save jquery-jcreate

And now you can include it in you project with a <script> tag.

<script type="text/javascript" src="jquery.jcreate.min.js"></script>

@marcomontalbano marcomontalbano released this Mar 28, 2017 · 25 commits to master since this release

Assets 2

Added support for jQuery v3.2.x

@marcomontalbano marcomontalbano released this Jan 16, 2017 · 29 commits to master since this release

Assets 2

Added LICENSE

@marcomontalbano marcomontalbano released this Jan 9, 2017 · 31 commits to master since this release

Assets 2

Added Event object to callback.

  • type - Describes the nature of the event.
$( document ).on('create', 'a', function( event ) {
    console.log( event.type ); //= "create"
});
  • timeStamp - The difference in milliseconds between the time the browser created the event and January 1, 1970.
  • currentTarget - The current DOM element within the event bubbling phase.
$( document ).on('create', 'a', function( event ) {
    console.log( event.currentTarget === this ); //= true
});
  • $currentTarget - The current DOM element within the event bubbling phase as jQuery object.
$( document ).on('create', 'a', function( event ) {
    console.log( event.$currentTarget.is( $(this) ) ); //= true
});
  • delegateTarget - The element where the currently-called jQuery event handler was attached.
$( document ).on('create', 'a', function( event ) {
    console.log( event.delegateTarget === document ); //= true
});
  • $delegateTarget - The jQuery element where the currently-called jQuery event handler was attached.
$( document ).on('create', 'a', function( event ) {
    console.log( event.$delegateTarget.is( $(document) ) ); //= true
});
  • options - Method that filters data by key.
<div data-component-name="hello-world"></div>
$( document ).on('create', 'div', function( event ) {
    console.log( event.options('component') ); //= {name:"hello-world"}
});
Pre-release

@marcomontalbano marcomontalbano released this Dec 15, 2016

Assets 2

Addend Event object to callback.

  • type - Describes the nature of the event.
$( document ).on('create', 'a', function( event ) {
    console.log( event.type ); //= "create"
});
  • timeStamp - The difference in milliseconds between the time the browser created the event and January 1, 1970.
  • currentTarget - The current DOM element within the event bubbling phase.
$( document ).on('create', 'a', function( event ) {
    console.log( event.currentTarget === this ); //= true
});
  • $currentTarget - The current DOM element within the event bubbling phase as jQuery object.
$( document ).on('create', 'a', function( event ) {
    console.log( event.$currentTarget.is( $(this) ) ); //= true
});
  • delegateTarget - The element where the currently-called jQuery event handler was attached.
$( document ).on('create', 'a', function( event ) {
    console.log( event.delegateTarget === document ); //= true
});
  • $delegateTarget - The jQuery element where the currently-called jQuery event handler was attached.
$( document ).on('create', 'a', function( event ) {
    console.log( event.$delegateTarget.is( $(document) ) ); //= true
});
  • options - Method that filters data by key.
<div data-component-name="hello-world"></div>
$( document ).on('create', 'div', function( event ) {
    console.log( event.options('component') ); //= {name:"hello-world"}
});