From dbdcaaaa8d5c4b18de4e6b53e6cbf1af37428a82 Mon Sep 17 00:00:00 2001 From: Philipp Burgmer Date: Sun, 30 Mar 2014 01:52:27 +0100 Subject: [PATCH 1/3] perf(options): optimise amount of options added due to infinite scrolling, for smoother scrolling --- src/w11k-select.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/w11k-select.js b/src/w11k-select.js index 99937ac..a1d711b 100644 --- a/src/w11k-select.js +++ b/src/w11k-select.js @@ -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); From 2fca0ec7b33fb9aaeedc282800265dd5b24da2d8 Mon Sep 17 00:00:00 2001 From: Philipp Burgmer Date: Sun, 30 Mar 2014 01:52:38 +0100 Subject: [PATCH 2/3] chore(project): bump version to 0.3.2 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 2133294..d95db03 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "w11k-select", - "version": "0.3.1", + "version": "0.3.2", "dependencies": { "angular": "1.2.x", diff --git a/package.json b/package.json index 36cdd9c..82792b0 100644 --- a/package.json +++ b/package.json @@ -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" ], From 1928e7b5d4c0396e18fdd55241f65932bd27eedf Mon Sep 17 00:00:00 2001 From: Philipp Burgmer Date: Sun, 30 Mar 2014 01:53:45 +0100 Subject: [PATCH 3/3] docs(changelog): update changelog for 0.3.2 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52b118c..d54d29b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ + +## 0.3.2 (2014-03-30) + +### Features + +* **performance:** optimise amount of options added due to infinite scrolling, for smoother scrolling + + ## 0.3.1 (2014-03-30)