Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
HAWKULAR-584 : Initial implementation of infinte scroll for URL list
Browse files Browse the repository at this point in the history
  • Loading branch information
ammendonca committed Aug 31, 2015
1 parent f26503d commit ec22d88
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"angular-scroll": "0.6.5",
"angular-ui-select": "0.11.2",
"angular-toastr": "1.4.1",
"ngInfiniteScroll": "1.2.1",
"bootstrap-select": "1.6",
"hawkular-charts": "~0.4.15",
"hawkular-ui-services": "~0.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2 ng-show="vm.resourceList.length > 0" class="text-center hk-fade-in">Current
</div>
</div>

<div ng-class="{'hk-fade-in': vm.resourceList}">
<div ng-class="{'hk-fade-in': vm.resourceList}" infinite-scroll="vm.addMoreItems()">
<div class="hk-url-item" ng-repeat="res in vm.resourceList | orderBy:'properties.url':vm.reverse">
<div class="panel panel-default hk-url-heading">
<a href="/hawkular-ui/url/availability/{{res.id}}">{{res.properties.url}}</a>
Expand Down
3 changes: 2 additions & 1 deletion console/src/main/scripts/plugins/metrics/ts/metricsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
module HawkularMetrics {

export var _module = angular.module(HawkularMetrics.pluginName, ['ngResource', 'ui.select', 'hawkular.charts',
'hawkular.services', 'ui.bootstrap', 'topbar', 'patternfly.select', 'angular-momentjs', 'angular-md5', 'toastr']);
'hawkular.services', 'ui.bootstrap', 'topbar', 'patternfly.select', 'angular-momentjs', 'angular-md5', 'toastr',
'infinite-scroll']);

_module.config(['$httpProvider', '$locationProvider', '$routeProvider',
($httpProvider, $locationProvider) => {
Expand Down
9 changes: 9 additions & 0 deletions console/src/main/scripts/plugins/metrics/ts/urlList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ module HawkularMetrics {
this.resCurPage = page;
this.getResourceList();
}

public addMoreItems() {
if (this.resourceList.length > 0) {
this.resPerPage += 5;
console.log(this.resPerPage);
this.getResourceList();
}
}

}

class DeleteResourceModalController {
Expand Down

0 comments on commit ec22d88

Please sign in to comment.