Bug 1250772 - Remove softkb-change observer listener. r=mossop

MozReview-Commit-ID: 2PkpjTSVSsM
This commit is contained in:
Makoto Kato 2016-02-24 12:52:38 +09:00
parent ca4f352f10
commit a394085601

View File

@ -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);
}
}