changes for navigation buttons

This commit is contained in:
yuri
2015-10-30 17:48:48 +02:00
parent 3eb6648d2b
commit 9fb88a6b92
4 changed files with 17 additions and 8 deletions
@@ -14,7 +14,7 @@
</ul>
{{/if}}
</div>
{{#if nextPreviousButtonsEnabled}}
{{#if navigateButtonsEnabled}}
<div class="pull-right">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default action {{#unless previousButtonEnabled}} disabled{{/unless}}" data-action="previous">
+11 -4
View File
@@ -90,6 +90,8 @@ Espo.define('views/record/detail', 'views/record/base', function (Dep) {
editModeDisabled: false,
navigateButtonsDisabled: false,
readOnly: false,
isWide: false,
@@ -316,12 +318,11 @@ Espo.define('views/record/detail', 'views/record/base', function (Dep) {
},
data: function () {
var nextPreviousButtonsEnabled = !!this.model.collection;
var navigateButtonsEnabled = !this.navigateButtonsDisabled && !!this.model.collection;
var previousButtonEnabled = false;
var nextButtonEnabled = false;
if (nextPreviousButtonsEnabled) {
if (navigateButtonsEnabled) {
if (this.indexOfRecord > 0) {
previousButtonEnabled = true;
}
@@ -351,7 +352,7 @@ Espo.define('views/record/detail', 'views/record/base', function (Dep) {
id: this.id,
isWide: this.isWide,
isSmall: this.type == 'editSmall' || this.type == 'detailSmall',
nextPreviousButtonsEnabled: nextPreviousButtonsEnabled,
navigateButtonsEnabled: navigateButtonsEnabled,
previousButtonEnabled: previousButtonEnabled,
nextButtonEnabled: nextButtonEnabled
}
@@ -447,6 +448,12 @@ Espo.define('views/record/detail', 'views/record/base', function (Dep) {
}
}
if (!this.navigateButtonsDisabled) {
if ('navigateButtonsDisabled' in this.options) {
this.navigateButtonsDisabled = this.options.navigateButtonsDisabled;
}
}
if (this.model.isNew()) {
this.isNew = true;
this.removeButton('delete');
+1 -1
View File
@@ -601,7 +601,7 @@ td.cell-buttons > .btn-group {
.stick-sub.button-container {
background-color: @body-bg;
padding: 3px 3px 3px 0;
padding: 3px @container-padding*2 3px 0;
width: 100%;
}
+4 -2
View File
@@ -17,11 +17,13 @@
@grid-gutter-width: 16px;
@container-lg: @container-large-desktop;
@container-padding: 15px;
.container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
padding-left: @container-padding;
padding-right: @container-padding;
.clearfix();
}