Updated Branches: refs/heads/ui-restyle 116e06e3b -> ec4361e2f
Dialog: Auto-center dialogs on load and window resize Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ec4361e2 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ec4361e2 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ec4361e2 Branch: refs/heads/ui-restyle Commit: ec4361e2f525d6803ef72d37755218db89b925e4 Parents: 116e06e Author: Brian Federle <[email protected]> Authored: Wed Oct 16 15:09:53 2013 -0700 Committer: Brian Federle <[email protected]> Committed: Wed Oct 16 15:09:53 2013 -0700 ---------------------------------------------------------------------- ui/scripts/ui/dialog.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec4361e2/ui/scripts/ui/dialog.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index c207788..4de8423 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -15,6 +15,18 @@ // specific language governing permissions and limitations // under the License. (function($, cloudStack, _l) { + $(function() { + $.ui.dialog.prototype.options.autoReposition = true; + $(window).resize(function () { + $(".ui-dialog-content:visible").each(function () { + var dialog = $(this).data("dialog"); + if (dialog.options.autoReposition) { + dialog.option("position", dialog.options.position); + } + }); + }); + }); + cloudStack.dialog = { /** * Error message form
