navbar panel height

This commit is contained in:
yuri
2018-08-02 15:05:00 +03:00
parent e375105a5f
commit 71864056bc
3 changed files with 30 additions and 10 deletions
+18 -6
View File
@@ -32,8 +32,14 @@ Espo.define('views/global-search/panel', 'view', function (Dep) {
template: 'global-search/panel',
afterRender: function () {
setup: function () {
this.maxSize = this.getConfig().get('globalSearchMaxSize') || 10;
this.navbarPanelHeightSpace = this.getThemeManager().getParam('navbarPanelHeightSpace') || 100;
this.navbarPanelBodyMaxHeight = this.getThemeManager().getParam('navbarPanelBodyMaxHeight') || 600;
},
afterRender: function () {
this.listenToOnce(this.collection, 'sync', function () {
this.createView('list', 'views/record/list-expanded', {
el: this.options.el + ' .list-container',
@@ -46,7 +52,7 @@ Espo.define('views/global-search/panel', 'view', function (Dep) {
view: 'views/global-search/name-field',
params: {
containerEl: this.options.el
},
}
}
]
],
@@ -59,12 +65,18 @@ Espo.define('views/global-search/panel', 'view', function (Dep) {
}, function (view) {
view.render();
});
}.bind(this));
this.collection.maxSize = this.getConfig().get('recordsPerPageSmall') || 10;
}, this);
this.collection.reset();
this.collection.maxSize = this.maxSize;
this.collection.fetch();
var windowHeight = $(window).height();
if (windowHeight - this.navbarPanelBodyMaxHeight < this.navbarPanelHeightSpace) {
var maxHeight = windowHeight - this.navbarPanelHeightSpace;
this.$el.find('> .panel > .panel-body').css('maxHeight', maxHeight + 'px');
}
}
});
});
+11 -3
View File
@@ -51,9 +51,12 @@ Espo.define('views/notification/panel', 'view', function (Dep) {
this.wait(true);
this.getCollectionFactory().create('Notification', function (collection) {
this.collection = collection;
collection.maxSize = 5;
collection.maxSize = this.getConfig().get('notificationsMaxSize') || 5;
this.wait(false);
}, this);
this.navbarPanelHeightSpace = this.getThemeManager().getParam('navbarPanelHeightSpace') || 100;
this.navbarPanelBodyMaxHeight = this.getThemeManager().getParam('navbarPanelBodyMaxHeight') || 600;
},
afterRender: function () {
@@ -71,7 +74,7 @@ Espo.define('views/notification/panel', 'view', function (Dep) {
view: 'views/notification/fields/container',
params: {
containerEl: this.options.el
},
}
}
]
],
@@ -86,8 +89,13 @@ Espo.define('views/notification/panel', 'view', function (Dep) {
});
}, this);
this.collection.fetch();
var windowHeight = $(window).height();
if (windowHeight - this.navbarPanelBodyMaxHeight < this.navbarPanelHeightSpace) {
var maxHeight = windowHeight - this.navbarPanelHeightSpace;
this.$el.find('> .panel > .panel-body').css('maxHeight', maxHeight + 'px');
}
}
});
});
+1 -1
View File
@@ -137,7 +137,7 @@
@panel-border-width: 2px;
@navbar-panel-body-max-height: 350px;
@navbar-panel-body-max-height: 600px;
@form-group-margin-bottom: 12px;