Skip to content

Commit ec4361e

Browse files
committed
Dialog: Auto-center dialogs on load and window resize
1 parent 116e06e commit ec4361e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎ui/scripts/ui/dialog.js‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717
(function($, cloudStack, _l) {
18+
$(function() {
19+
$.ui.dialog.prototype.options.autoReposition = true;
20+
$(window).resize(function () {
21+
$(".ui-dialog-content:visible").each(function () {
22+
var dialog = $(this).data("dialog");
23+
if (dialog.options.autoReposition) {
24+
dialog.option("position", dialog.options.position);
25+
}
26+
});
27+
});
28+
});
29+
1830
cloudStack.dialog = {
1931
/**
2032
* Error message form

0 commit comments

Comments
 (0)