Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "bulkjs", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "manager for multiple selection.", | ||
"main": "bulk.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha ./tests/test.js -w" | ||
}, | ||
@@ -22,3 +22,7 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/diasbruno/bulkjs#readme" | ||
"homepage": "https://github.com/diasbruno/bulkjs#readme", | ||
"devDependencies": { | ||
"mocha": "^2.4.5", | ||
"should": "^8.2.2" | ||
} | ||
} |
@@ -1,4 +0,45 @@ | ||
bulkjs | ||
====== | ||
# bulkjs | ||
base for a manager for multiple selection. | ||
## Example | ||
```javascript | ||
// the api. | ||
var bulkAction = bulk(scope, { | ||
// toId maps the object from the data source, | ||
// to the unique id in the list. | ||
toId: function(x) { | ||
return x.uuid; | ||
}, | ||
// updates will always be executed for any change, | ||
// except when settings the 'dataSource'. | ||
update: function(scope, event, eventName) { | ||
// get the list of selected ids. | ||
var selected = scope.bulkAction.list(); | ||
// if not 'all', unmark the all checkbox. | ||
if (!scope.bulkAction.all()) { | ||
all[0].checked = ''; | ||
} else { | ||
all[0].checked = 'checked'; | ||
} | ||
// mark as checked if the uuid is in the selected list. | ||
scope.collection.map(function(o, k) { | ||
var checked = selected.indexOf(o.uuid) > -1; | ||
o.content.checked = checked ? 'checked' : ''; | ||
}); | ||
// display info. | ||
if (scope.bulkAction.all()) { | ||
sl.html("all"); | ||
} else { | ||
if (selected.length > 0) { | ||
sl.html(selected.join(",")); | ||
} else { | ||
sl.html("none"); | ||
} | ||
} | ||
} | ||
}); | ||
``` |
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
28183
21
231
1
46
2