ax5ui-binder
Advanced tools
Comparing version 1.3.81 to 1.3.82
{ | ||
"name": "ax5ui-binder", | ||
"version": "1.3.81", | ||
"version": "1.3.82", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "ThomasJ <tom@axisj.com>" |
{ | ||
"name": "ax5ui-binder", | ||
"version": "1.3.81", | ||
"version": "1.3.82", | ||
"description": "Simple 2way binder plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -108,3 +108,3 @@ /* | ||
describe('Manipulate list item TEST', function(){ | ||
describe('Manipulate list item TEST', function () { | ||
var myUI; | ||
@@ -120,15 +120,15 @@ var tmpl = '<form class name="binder-list-form" onsubmit="return false;" style="border: 1px solid #ccc;padding: 10px;border-radius: 10px;">' + | ||
$(document.body).append(tmpl); | ||
myUI = new ax5.ui.binder(); | ||
myUI.setModel({ | ||
"list": [{A: 1}, {A: 2}] | ||
}, jQuery(document["binder-list-form"])); | ||
myUI = new ax5.ui.binder(); | ||
myUI.setModel({ | ||
"list": [{A: 1}, {A: 2}, {A: [{a: 1}, {a: 2}, {a: 3}]}] | ||
}, jQuery(document["binder-list-form"])); | ||
it('add item ax5binder', function (done) { | ||
it('add ax5binder', function (done) { | ||
myUI.add("list", {A: 3}); | ||
done(myUI.get("list[2][A]") === 3 && myUI.get("list[2]" + "__ADDED__") === true ? "" : "add item error"); | ||
done(myUI.get("list[3][A]") === 3 && myUI.get("list[3]" + "__ADDED__") === true ? "" : "add error"); | ||
}); | ||
it('remove item ax5binder', function (done) { | ||
it('remove ax5binder', function (done) { | ||
myUI.remove("list", 1); | ||
done(myUI.get("list[1]" + "__DELETED__") === true ? "" : "remove item error"); | ||
done(myUI.get("list[1]" + "__DELETED__") === true ? "" : "remove error"); | ||
}); | ||
@@ -138,10 +138,35 @@ | ||
myUI.add("list", {A: 3}); | ||
myUI.remove("list", 2); | ||
done(myUI.get("list").length === 3 && myUI.get("list[1][A]") === 2 ? "" : "remove added item error"); | ||
myUI.remove("list", 3); | ||
done(myUI.get("list").length === 4 && myUI.get("list[3][A]") === 3 ? "" : "remove added item error"); | ||
}); | ||
it('update item ax5binder', function (done) { | ||
it('update ax5binder', function (done) { | ||
myUI.update("list", 1, {A: 3}); | ||
done(myUI.get("list[1][A]") === 3 ? "" : "update item error"); | ||
done(myUI.get("list[1][A]") === 3 ? "" : "update error"); | ||
}); | ||
it('childAdd ax5binder', function (done) { | ||
myUI.childAdd("list", 2, "A", {d: 4}); | ||
done(myUI.get("list[2][A][3][d]") === 4 ? "" : "childAdd error"); | ||
}); | ||
it('childAdd ax5binder', function (done) { | ||
myUI.childAdd("list", 2, "A", {d: 4}); | ||
done(myUI.get("list[2][A][3][d]") === 4 ? "" : "childAdd error"); | ||
}); | ||
it('childRemove ax5binder', function (done) { | ||
myUI.childRemove("list", 2, "A", 3); | ||
done(myUI.get("list[2][A]").length === 4 ? "" : "childRemove error"); | ||
}); | ||
it('childUpdate ax5binder', function (done) { | ||
myUI.childUpdate("list", 2, "A", 3, {d: 5}); | ||
done(myUI.get("list[2][A][3][d]") === 5 ? "" : "childUpdate error"); | ||
}); | ||
it('childSet ax5ui', function (done) { | ||
myUI.childSet("list", 2, "A", [{a: 10}, {b: 20}]); | ||
done(myUI.get("list[2][A]").length === 2 && myUI.get("list[2][A][0][a]") === 10 ? "" : "childSet error"); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227560
1767