Bug Tracker

Modify

Ticket #2028 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

X/Y parameters to dialogs, example included

Reported by: jontsa Owned by:
Priority: minor Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

Please add X/Y parameters to dialog options. The current "position" parameter is too limited so I use the following patch:

Index: /resources/trunk/js/jquery/ui/dialog.js
===================================================================
--- /resources/trunk/js/jquery/ui/dialog.js (revision 8114)
+++ /resources/trunk/js/jquery/ui/dialog.js (revision 8168)
@@ -36,5 +36,7 @@
 			drag: true,
 			resize: true,
-			shadow: false // It's quite slow
+			shadow: false, // It's quite slow
+			x: false,
+			y: false
 		};
 		var o = o || {}; $.extend(options, o); //Extend and copy options
@@ -108,5 +110,5 @@
 					break;
 			}
-			uiDialog.css({top: top, left: left});
+			uiDialog.css({top: options.y?options.y:top, left: options.x?options.x:left});
 			uiDialog.appendTo('body').show();

Change History

comment:1 Changed 5 years ago by rworth

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [4076]. position option now accepts an array ([x, y]) in addition to strings.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.