Add pagingSize inside layout config

Change-Id: I8990b0fcd94df7c17110f7df4fc973809022c3f0
This commit is contained in:
flavien peyre 2015-08-12 13:26:33 -04:00
parent bc982cabde
commit 90957f83e9
3 changed files with 18 additions and 8 deletions

View File

@ -176,10 +176,19 @@ angular.module('bansho.config', [])
this.getTheme = function () { this.getTheme = function () {
var theme; var theme;
if (layoutConfig.data) { if (layoutConfig.data) {
theme = layoutConfig.data.banshoConfig.theme; theme = layoutConfig.data.banshoConfig.theme;
} }
return theme; return theme;
};
this.getPagingSize = function () {
var pagingSize;
if (layoutConfig.data) {
pagingSize = layoutConfig.data.banshoConfig.pagingSize;
}
return pagingSize;
}; };
var saveLayoutConfig = function () { var saveLayoutConfig = function () {

View File

@ -1,6 +1,7 @@
{ {
"banshoConfig": { "banshoConfig": {
"theme": "dark" "theme": "dark",
"pagingSize": 50
}, },
"topbar": { "topbar": {
"template": "page", "template": "page",

View File

@ -3,8 +3,8 @@
angular.module('bansho.datasource', ['bansho.surveil']) angular.module('bansho.datasource', ['bansho.surveil'])
.value('tableGlobalConfig', {'cellToFieldsMap': {}, 'cellWrappableField': {}}) .value('tableGlobalConfig', {'cellToFieldsMap': {}, 'cellWrappableField': {}})
.service('datasource', ['$filter', 'surveilStatus', 'surveilConfig', 'surveilQuery', 'componentsConfig', 'tableGlobalConfig', .service('datasource', ['$filter', 'surveilStatus', 'surveilConfig', 'surveilQuery', 'componentsConfig', 'tableGlobalConfig', 'configManager',
function ($filter, surveilStatus, surveilConfig, surveilQuery, componentsConfig, tableGlobalConfig) { function ($filter, surveilStatus, surveilConfig, surveilQuery, componentsConfig, tableGlobalConfig, configManager) {
var providerServices = { var providerServices = {
status: surveilStatus, status: surveilStatus,
config: surveilConfig config: surveilConfig
@ -60,7 +60,7 @@ angular.module('bansho.datasource', ['bansho.surveil'])
if (config[tableId].pagingbar) { if (config[tableId].pagingbar) {
config[tableId].queryPaging = { config[tableId].queryPaging = {
page: 0, page: 0,
size: 50 size: configManager.getPagingSize()
}; };
} }
}, },