Skip to content

Commit d201bc3

Browse files
author
Ben TORFS
committed
Fixed performance issue
1 parent 63f7c63 commit d201bc3

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

dist/angular-bootstrap-multiselect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if ($scope.selectedOptions) {
6464
$scope.selectedOptions = [];
6565
}
66-
$scope.unselectedOptions = angular.copy($scope.resolvedOptions);
66+
$scope.unselectedOptions = $scope.resolvedOptions.slice(); // Take a copy
6767
} else {
6868
$scope.selectedOptions = $scope.resolvedOptions.filter(function (el) {
6969
var id = $scope.getId(el);

dist/angular-bootstrap-multiselect.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Angular Bootstrap Multiselect
55

66
Find documentation on [ the github page](http://bentorfs.github.io/angular-bootstrap-multiselect/)
77

8+
Contributions welcome

src/multiselect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
if ($scope.selectedOptions) {
6464
$scope.selectedOptions = [];
6565
}
66-
$scope.unselectedOptions = angular.copy($scope.resolvedOptions);
66+
$scope.unselectedOptions = $scope.resolvedOptions.slice(); // Take a copy
6767
} else {
6868
$scope.selectedOptions = $scope.resolvedOptions.filter(function (el) {
6969
var id = $scope.getId(el);

test/e2e/test-objectmodels.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h3>Test with many items</h3>
5252
</div>
5353

5454
<script src="../../bower_components/angular/angular.js"></script>
55-
<script src="../../dist/angular-bootstrap-multiselect.min.js"></script>
55+
<script src="../../dist/angular-bootstrap-multiselect.js"></script>
5656
<script>
5757
angular.module('testApp', ['btorfs.multiselect']);
5858
angular.module('testApp').controller('TestController', ['$scope', function ($scope) {
@@ -63,7 +63,7 @@ <h3>Test with many items</h3>
6363
{name: 'element4', id: 4}
6464
];
6565
$scope.options2 = [];
66-
for (var i = 0; i < 10000; i++) {
66+
for (var i = 0; i < 100000; i++) {
6767
$scope.options2.push({name: 'element' + i, id: i});
6868
}
6969

0 commit comments

Comments
 (0)