From 7de7af4cc1e4f31e3b03178a15524bd33d636e76 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 12 Sep 2016 15:59:43 +0200 Subject: [PATCH] Implement position attribute for widget dialog --- api/js/etemplate/et2_widget_dialog.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_dialog.js b/api/js/etemplate/et2_widget_dialog.js index 51867493c1..00dcf7e24b 100644 --- a/api/js/etemplate/et2_widget_dialog.js +++ b/api/js/etemplate/et2_widget_dialog.js @@ -173,6 +173,12 @@ var et2_dialog = (function(){ "use strict"; return et2_widget.extend( type: "string", description: "Define width of dialog, the default is auto", "default": 'auto' + }, + position: { + name: "position", + type: "string", + description: "Define position of dialog in the main window", + default: "center" } }, @@ -483,7 +489,8 @@ var et2_dialog = (function(){ "use strict"; return et2_widget.extend( jQuery(this).parents('.ui-dialog-buttonpane button[default]').focus(); }, close: jQuery.proxy(function() {this.destroy();},this), - beforeClose: this.options.beforeClose + beforeClose: this.options.beforeClose, + position: {my:this.options.position, at:this.options.position, of:window} }); } });}).call(this);