From e0ad35a241d0fe5cffea508b1fcea41fa2d8120b Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 14 May 2018 15:16:25 -0600 Subject: [PATCH] Let et2_dialogs size themselves according to contents unless otherwise specified. Fixes dialogs too narrow for their title --- api/js/etemplate/et2_widget_dialog.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/et2_widget_dialog.js b/api/js/etemplate/et2_widget_dialog.js index 8d65d8a029..3daea9d610 100644 --- a/api/js/etemplate/et2_widget_dialog.js +++ b/api/js/etemplate/et2_widget_dialog.js @@ -474,12 +474,12 @@ var et2_dialog = (function(){ "use strict"; return et2_widget.extend( this.set_dialog_type(this.options.dialog_type); } this.set_buttons(typeof this.options.buttons == "number" ? this._buttons[this.options.buttons] : this.options.buttons); - this.div.dialog({ + + var options = { // Pass the internal object, not the option buttons: this.options.buttons, modal: this.options.modal, resizable: this.options.resizable, - width: this.options.width, minWidth: this.options.minWidth, minHeight:this.options.minHeight, maxWidth: 640, @@ -492,7 +492,14 @@ var et2_dialog = (function(){ "use strict"; return et2_widget.extend( beforeClose: this.options.beforeClose, closeText: this.egw().lang('close'), position: {my:this.options.position, at:this.options.position, of:window} - }); + }; + // Leaving width unset lets it size itself according to contents + if(this.options.width && this.options.width !== 'auto') + { + options.width = this.options.width; + } + + this.div.dialog(options); } });}).call(this); et2_register_widget(et2_dialog, ["dialog"]);