Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Burgmer committed Mar 30, 2014
2 parents de546e4 + 1928e7b commit 5df753d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<a name="0.3.2"></a>
## 0.3.2 (2014-03-30)

### Features

* **performance:** optimise amount of options added due to infinite scrolling, for smoother scrolling


<a name="0.3.1"></a>
## 0.3.1 (2014-03-30)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "w11k-select",
"version": "0.3.1",
"version": "0.3.2",

"dependencies": {
"angular": "1.2.x",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "w11k-select",
"version": "0.3.1",
"version": "0.3.2",

"description": "single- and multi-select directive for angularjs",
"keywords": [ "angular", "angularjs", "directive", "select", "multi-select", "bootstrap" ],
Expand Down
8 changes: 5 additions & 3 deletions src/w11k-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,21 @@ angular.module('w11k.select').directive('w11kSelect', [

var filter = $filter('filter');
var limitTo = $filter('limitTo');
var initialLimitTo = 80;
var increaseLimitTo = initialLimitTo * 0.5;

function filterOptions() {
if (hasBeenOpened) {
optionsFiltered = filter(options, scope.filter.values, false);
scope.optionsToShow = limitTo(optionsFiltered, 100);
scope.optionsToShow = limitTo(optionsFiltered, initialLimitTo);
}
}

scope.showMoreOptions = function () {
scope.optionsToShow = optionsFiltered.slice(0, scope.optionsToShow.length + 100);
scope.optionsToShow = optionsFiltered.slice(0, scope.optionsToShow.length + increaseLimitTo);
};

// read the selected-message attribute once
// read the filter-placeholder attribute once
var filterPlaceholderAttrObserver = attrs.$observe('filterPlaceholder', function (filterPlaceholder) {
if (angular.isDefined(filterPlaceholder)) {
scope.filter.placeholder = scope.$eval(filterPlaceholder);
Expand Down

0 comments on commit 5df753d

Please sign in to comment.