diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 017e3f15ad..b1fb40d255 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -179,7 +179,7 @@ define([ '<% if (typeof (buttons) !== "undefined" && _.size(buttons) > 0) { %>' + '
' + '<% } %>' + @@ -629,12 +629,12 @@ define([ var newBtns = {}; _.each(options.buttons, function(b){ if (typeof(b) == 'object') { - if (b.value !== undefined) - newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; + if (b.value !== undefined) { + newBtns[b.value] = {text: b.caption, cls: 'auto' + ((b.primary || options.primary==b.value) ? ' primary' : '')}; + b.id && (newBtns[b.value].id = b.id); + } } else if (b!==undefined) { - newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''}; - if (b=='custom') - newBtns[b].cls += ' custom'; + newBtns[b] = {text: arrBtns[b], cls: (options.primary==b || _.indexOf(options.primary, b)>-1) ? 'primary' : ''}; } }); diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 2d96fc1224..6324e16a98 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -1327,7 +1327,7 @@ opacity: @component-disabled-opacity; } - &.custom { + &.auto { width: auto; min-width: 86px; } diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index dec84cce44..932ea4c7f2 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2640,9 +2640,8 @@ define([ width: 500, msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + buttons: this.appOptions.canChangeCoAuthoring ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', - customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ if (dontshow) Common.localStorage.setItem("de-hide-try-undoredo", 1); diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js index b72453c3c0..bc8aa14acf 100644 --- a/apps/documenteditor/main/app/view/MailMergeSettings.js +++ b/apps/documenteditor/main/app/view/MailMergeSettings.js @@ -639,9 +639,8 @@ define([ title: this.notcriticalErrorTitle, msg: opts.data.error, iconCls: 'warn', - buttons: _.isEmpty(opts.data.createEmailAccountUrl) ? ['ok'] : ['custom', 'cancel'], + buttons: _.isEmpty(opts.data.createEmailAccountUrl) ? ['ok'] : [{value: 'custom', caption: this.textGoToMail}, 'cancel'], primary: _.isEmpty(opts.data.createEmailAccountUrl) ? ['ok'] : 'custom', - customButtonText: this.textGoToMail, callback: _.bind(function(btn){ if (btn == 'custom') { window.open(opts.data.createEmailAccountUrl, "_blank"); diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js index 606f5db592..c767424c38 100644 --- a/apps/pdfeditor/main/app/controller/Main.js +++ b/apps/pdfeditor/main/app/controller/Main.js @@ -2034,9 +2034,8 @@ define([ width: 500, msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + buttons: this.appOptions.canChangeCoAuthoring ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', - customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ if (dontshow) Common.localStorage.setItem("pdfe-hide-try-undoredo", 1); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 0bf6520405..86b7c5858c 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -2198,9 +2198,8 @@ define([ width: 500, msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + buttons: this.appOptions.canChangeCoAuthoring ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', - customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ if (dontshow) window.localStorage.setItem("pe-hide-try-undoredo", 1); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index e13b5caa73..dde29e0333 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2933,9 +2933,8 @@ define([ width: 500, msg: this.appOptions.canChangeCoAuthoring ? this.textTryUndoRedo : this.textTryUndoRedoWarn, iconCls: 'info', - buttons: this.appOptions.canChangeCoAuthoring ? ['custom', 'cancel'] : ['ok'], + buttons: this.appOptions.canChangeCoAuthoring ? [{value: 'custom', caption: this.textStrict}, 'cancel'] : ['ok'], primary: this.appOptions.canChangeCoAuthoring ? 'custom' : 'ok', - customButtonText: this.textStrict, dontshow: true, callback: _.bind(function(btn, dontshow){ if (dontshow) window.localStorage.setItem("sse-hide-try-undoredo", 1);