diff --git a/client/modules/crm/src/views/meeting/modals/detail.js b/client/modules/crm/src/views/meeting/modals/detail.js index a6f2010000..c32743c5f8 100644 --- a/client/modules/crm/src/views/meeting/modals/detail.js +++ b/client/modules/crm/src/views/meeting/modals/detail.js @@ -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) { diff --git a/client/src/views/modal.js b/client/src/views/modal.js index b9a9a1f05b..b63faac2d2 100644 --- a/client/src/views/modal.js +++ b/client/src/views/modal.js @@ -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); }