Comparing version 0.1.1 to 0.1.4
28
bulk.js
@@ -8,3 +8,2 @@ /*global require, module */ | ||
var isSelectedAll = false; | ||
var selected = []; | ||
@@ -18,4 +17,4 @@ var source = []; | ||
mark: function(item_uuid, event) { | ||
if (isSelectedAll) { | ||
isSelectedAll = false; | ||
if (selected.indexOf(item_uuid) > -1) { | ||
return; | ||
} | ||
@@ -25,8 +24,4 @@ | ||
if (source.length == selected.length) { | ||
isSelectedAll = true; | ||
} | ||
if (opts.update) { | ||
opts.update(scope, event, 'mark'); | ||
opts.update(scope, event, "mark"); | ||
} | ||
@@ -36,22 +31,19 @@ }, | ||
selected = selected.filter(filter); | ||
isSelectedAll = false; | ||
if (opts.update) { | ||
opts.update(scope, event, 'unmark'); | ||
opts.update(scope, event, "unmark"); | ||
} | ||
}, | ||
markAll: function(event) { | ||
isSelectedAll = true; | ||
selected = source.map(opts.toId); | ||
if (opts.update) { | ||
opts.update(scope, event, 'markAll'); | ||
opts.update(scope, event, "markAll"); | ||
} | ||
}, | ||
cleanAll: function(event) { | ||
isSelectedAll = false; | ||
selected = []; | ||
if (opts.update) { | ||
opts.update(scope, event, 'cleanAll'); | ||
opts.update(scope, event, "cleanAll"); | ||
} | ||
@@ -71,6 +63,6 @@ }, | ||
toogleAll: function(event) { | ||
if (!isSelectedAll) { | ||
this.markAll(event, 'markAll'); | ||
if (!this.all()) { | ||
this.markAll(event, "markAll"); | ||
} else { | ||
this.cleanAll(event, 'cleanAll'); | ||
this.cleanAll(event, "cleanAll"); | ||
} | ||
@@ -85,3 +77,3 @@ }, | ||
all: function() { | ||
return isSelectedAll; | ||
return source.length == selected.length; | ||
}, | ||
@@ -88,0 +80,0 @@ count: function() { |
{ | ||
"name": "bulkjs", | ||
"version": "0.1.1", | ||
"version": "0.1.4", | ||
"description": "manager for multiple selection.", | ||
@@ -5,0 +5,0 @@ "main": "bulk.js", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
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
11040
13
206
5
2
2