modal add button before specific
This commit is contained in:
@@ -41,7 +41,7 @@ define('crm:views/meeting/modals/detail', 'views/modals/detail', function (Dep)
|
||||
pullLeft: false,
|
||||
hidden: this.hasAcceptanceStatusButton(),
|
||||
style: buttonData.style,
|
||||
}, false);
|
||||
}, 'cancel');
|
||||
|
||||
this.initAcceptenceStatus();
|
||||
this.on('switch-model', function (model, previousModel) {
|
||||
|
||||
@@ -207,17 +207,25 @@ Espo.define('views/modal', 'view', function (Dep) {
|
||||
this.$el.find('footer button[data-name="'+name+'"]').removeClass('disabled').removeAttr('disabled');
|
||||
},
|
||||
|
||||
addButton: function (o, toBeginnig, doNotReRender) {
|
||||
addButton: function (o, position, doNotReRender) {
|
||||
var index = -1;
|
||||
this.buttonList.forEach(function (item, i) {
|
||||
if (item.name === o.name) {
|
||||
index = i;
|
||||
}
|
||||
if (item.name === o.name) index = i;
|
||||
}, this);
|
||||
if (~index) return;
|
||||
|
||||
if (toBeginnig) {
|
||||
if (position === true) {
|
||||
this.buttonList.unshift(o);
|
||||
} else if (typeof position === 'string') {
|
||||
index = -1;
|
||||
this.buttonList.forEach(function (item, i) {
|
||||
if (item.name === position) index = i;
|
||||
}, this);
|
||||
if (~index) {
|
||||
this.buttonList.splice(index, 0, o);
|
||||
} else {
|
||||
this.buttonList.push(o);
|
||||
}
|
||||
} else {
|
||||
this.buttonList.push(o);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user