зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1250772 - Remove softkb-change observer listener. r=mossop
MozReview-Commit-ID: 2PkpjTSVSsM --HG-- extra : rebase_source : 53688c2352da873d8131109c5a9b2eb60f2e16c8
This commit is contained in:
Родитель
2697b8c4a2
Коммит
25b679c83e
|
@ -47,7 +47,6 @@ function commonDialogOnLoad() {
|
|||
|
||||
// limit the dialog to the screen width
|
||||
document.getElementById("filler").maxWidth = screen.availWidth;
|
||||
Services.obs.addObserver(softkbObserver, "softkb-change", false);
|
||||
|
||||
Dialog = new CommonDialog(args, ui);
|
||||
Dialog.onLoad(dialog);
|
||||
|
@ -55,19 +54,7 @@ function commonDialogOnLoad() {
|
|||
}
|
||||
|
||||
function commonDialogOnUnload() {
|
||||
Services.obs.removeObserver(softkbObserver, "softkb-change");
|
||||
// Convert args back into property bag
|
||||
for (let propName in args)
|
||||
propBag.setProperty(propName, args[propName]);
|
||||
}
|
||||
|
||||
function softkbObserver(subject, topic, data) {
|
||||
let rect = JSON.parse(data);
|
||||
if (rect) {
|
||||
let height = rect.bottom - rect.top;
|
||||
let width = rect.right - rect.left;
|
||||
let top = (rect.top + (height - window.innerHeight) / 2);
|
||||
let left = (rect.left + (width - window.innerWidth) / 2);
|
||||
window.moveTo(left, top);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче