Reposition dialog before focusing on it, so scrolling does not happen prematurely.

This commit is contained in:
Austin Matzko 2014-01-02 14:59:17 -05:00
Родитель def77bf82d
Коммит 1feb2a504a
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -108,6 +108,13 @@ var dialogPolyfill = (function() {
findElementToFocus(this); findElementToFocus(this);
if (dialogPolyfill.needsCentering(this))
dialogPolyfill.reposition(this);
if (isModal) {
this.dialogPolyfillInfo.modal = true;
dialogPolyfill.dm.pushDialog(this);
}
// IE sometimes complains when calling .focus() that it // IE sometimes complains when calling .focus() that it
// "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus." // "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."
try { try {
@ -117,13 +124,6 @@ var dialogPolyfill = (function() {
first_form_ctrl.focus(); first_form_ctrl.focus();
} }
} catch(e) {} } catch(e) {}
if (dialogPolyfill.needsCentering(this))
dialogPolyfill.reposition(this);
if (isModal) {
this.dialogPolyfillInfo.modal = true;
dialogPolyfill.dm.pushDialog(this);
}
this.style.zoom = 1; this.style.zoom = 1;
}; };