Skip to content

Commit

Permalink
1.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
kupriyanenko committed Jul 7, 2014
1 parent f2fbcab commit 93509de
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jbone",
"version": "1.0.17",
"version": "1.0.18",
"main": "dist/jbone.js",
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jbone",
"repo": "kupriyanenko/jbone",
"description": "JavaScript Library for DOM manipulation. Replacement jQuery for Backbone in browsers (2.5kb gzipped)",
"version": "1.0.17",
"version": "1.0.18",
"keywords": [
"jquery",
"jbone",
Expand Down
57 changes: 37 additions & 20 deletions dist/jbone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jBone v1.0.17 - 2014-05-23 - Library for DOM manipulation
* jBone v1.0.18 - 2014-07-08 - Library for DOM manipulation
*
* https://github.com/kupriyanenko/jbone
*
Expand Down Expand Up @@ -708,6 +708,32 @@ fn.data = function(key, value) {
return this;
};

fn.removeData = function(key) {
var i = 0,
length = this.length,
jdata, dataset;

for (; i < length; i++) {
jdata = this[i].jdata;
dataset = this[i].dataset;

if (key) {
jdata && jdata[key] && delete jdata[key];
delete dataset[key];
} else {
for (key in jdata) {
delete jdata[key];
}

for (key in dataset) {
delete dataset[key];
}
}
}

return this;
};

fn.html = function(value) {
var args = arguments,
el;
Expand Down Expand Up @@ -738,26 +764,17 @@ fn.append = function(appended) {
appended = document.createTextNode(appended);
}

// just append NodeElement
if (appended instanceof Node) {
setter = function(el) {
el.appendChild(appended);
};
}
// wrap object by jBone, and then append
else {
appended = appended instanceof jBone ? appended : jBone(appended);
appended = appended instanceof jBone ? appended : jBone(appended);

setter = function(el, i) {
appended.forEach(function(node) {
if (i) {
el.appendChild(node.cloneNode());
} else {
el.appendChild(node);
}
});
};
}
setter = function(el, i) {
appended.forEach(function(node) {
if (i) {
el.appendChild(node.cloneNode());
} else {
el.appendChild(node);
}
});
};

for (; i < length; i++) {
setter(this[i], i);
Expand Down
4 changes: 2 additions & 2 deletions dist/jbone.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jbone",
"title": "jBone",
"version": "1.0.17",
"version": "1.0.18",
"description": "Library for DOM manipulation",
"main": "dist/jbone.js",
"homepage": "https://github.com/kupriyanenko/jbone",
Expand Down

0 comments on commit 93509de

Please sign in to comment.