Skip to content

Commit

Permalink
Tag v 1.1.0 updates README and repo url
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflabs committed May 13, 2016
1 parent 3c5b905 commit c93fc47
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')

SHELL = /usr/bin/env bash

default: install
.PHONY: default test install tag

version:
@echo $(VERSION)


install:
npm install
jspm install

update_version:
@echo "Current version is " ${VERSION}
@echo "Next version is " $(v)
sed -i s/"$(VERSION)"/"$(v)"/g package.json

tag_and_push:
git add --all
git commit -a -m "Tag v $(v) $(m)"
git tag v$(v)
git push
git push --tags
npm publish

tag: update_version tag_and_push

27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,21 @@ $('#mylist').append('<li class="third">Third item</li>');
But you don't know when or from where. With **jquery.waitforChild** you just can set a listener on the container:

```js
$('#mylist').waitforChild(function(child) {
child.addClass('pink');
},'li.second');
$('#mylist').waitforChild({
onFound: function(child) {
child.addClass('pink');
},
querySelector: 'li.second'
});
```

Now, whenever a matching childNode is inserted on *#mylist*, the function will be invoked on it.

### Apply the onFound function only once

There are some cases in which you will want to act on the first element to match the selection. If that's the case, you can pass a third parameter:
There are some cases in which you will want to act on the first element to match the selection, so further elements won't trigger
the handler function. In that case, pass the option `once` to the config object:

```js
$('#mylist').waitforChild(function(child) {
child.addClass('pink');
},'li.second',true);
```

Which will operate only on the first matching element ever appended to the container.

### Passing the parameters as an object

The plugin also accepts an object as the only argument, in the form:

```js
$('#mylist').waitforChild({
Expand All @@ -79,6 +72,10 @@ $('#mylist').waitforChild({
});
```

Which will operate only on the first matching element ever appended to the container.



### Chaining methods

The plugin returns the original element, so you are free to chain methods as with other jQuery functions
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "jquery.waitforChild",
"version": "1.0.1",
"version": "1.1.0",
"description": "jQuery plugin to declare handlers to be executed once a child node is appended to the target element",
"main": "jquery.waitforChild.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/amenadiel/jquery.waitforChild.git"
"url": "https://github.com/HuasoFoundries/jquery.waitforChild.git"
},
"keywords": [
"ecosystem:jquery",
Expand All @@ -18,7 +18,7 @@
"author": "Felipe Figueroa",
"license": "MIT",
"bugs": {
"url": "https://github.com/amenadiel/jquery.waitforChild/issues"
"url": "https://github.com/HuasoFoundries/jquery.waitforChild/issues"
},
"homepage": "https://github.com/amenadiel/jquery.waitforChild"
"homepage": "https://github.com/HuasoFoundries/jquery.waitforChild"
}

0 comments on commit c93fc47

Please sign in to comment.