diff --git a/client/core/src/components/drop-down/drop-down.html b/client/core/src/components/drop-down/drop-down.html
index c21498e8d..ce8d23a4f 100755
--- a/client/core/src/components/drop-down/drop-down.html
+++ b/client/core/src/components/drop-down/drop-down.html
@@ -9,10 +9,10 @@
+ model="$ctrl.search"
+ class="search"
+ ng-blur="$ctrl.onFocusOut()"
+ label = "Search">
diff --git a/client/core/src/components/pagination/pagination.html b/client/core/src/components/pagination/pagination.html
index 18353c0e1..9da15c002 100644
--- a/client/core/src/components/pagination/pagination.html
+++ b/client/core/src/components/pagination/pagination.html
@@ -4,7 +4,7 @@
ng-if="!$ctrl.model.isLoading"
icon="more_horiz"
vn-tooltip="Load more"
- ng-click="$ctrl.model.loadMore()">
+ ng-click="$ctrl.onLoadClick()">
this.onScroll(e);
}
@@ -50,14 +53,23 @@ class Pagination extends Component {
let scrollElement = this.scrollElement;
let shouldLoad =
scrollElement.scrollTop + scrollElement.clientHeight >= (scrollElement.scrollHeight - this.scrollOffset)
- && !this.model.isLoading;
+ && !this.model.isLoading
+ && (this.maxLoads <= 0 || this.nLoads < this.maxLoads);
if (shouldLoad) {
+ this.nLoads++;
this.model.loadMore();
this.$.$apply();
}
}
+ onLoadClick() {
+ if (this.maxLoads > 0 && this.nLoads == this.maxLoads)
+ this.nLoads = 0;
+
+ this.model.loadMore();
+ }
+
$onDestroy() {
this.scrollElement = null;
}
@@ -69,7 +81,8 @@ ngModule.component('vnPagination', {
model: '<',
scrollSelector: '@?',
scrollElement: '',
- scrollOffset: ''
+ scrollOffset: '',
+ maxLoads: ''
},
controller: Pagination
});
diff --git a/webpack.config.js b/webpack.config.js
index b6e0bfd18..0241ea3ff 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -58,7 +58,10 @@ let baseConfig = {
`${__dirname}/client`,
__dirname,
'node_modules'
- ]
+ ],
+ alias: {
+ 'vn-loopback': `${__dirname}/services/loopback`
+ }
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({