Dialog: Auto-center dialogs on load and window resize

This commit is contained in:
Brian Federle 2013-10-16 15:09:53 -07:00
parent 116e06e3ba
commit ec4361e2f5
1 changed files with 12 additions and 0 deletions

View File

@ -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