Bug 1250772 - Remove softkb-change observer listener. r=mossop
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 24 Feb 2016 12:52:38 +0900
changeset 322011 5ee600d6dd400703f09d1d35f969885d874e5e21
parent 322010 15498c6d989510e3c181e959e952486b58efbcdf
child 322012 a702f6bf94594534fa74dde6ef174a6d7639b6cd
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1250772
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250772 - Remove softkb-change observer listener. r=mossop MozReview-Commit-ID: 2PkpjTSVSsM
toolkit/components/prompts/content/commonDialog.js
--- a/toolkit/components/prompts/content/commonDialog.js
+++ b/toolkit/components/prompts/content/commonDialog.js
@@ -42,32 +42,19 @@ function commonDialogOnLoad() {
         button2            : dialog.getButton("extra1"),
         button1            : dialog.getButton("cancel"),
         button0            : dialog.getButton("accept"),
         focusTarget        : window,
     };
 
     // 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);
     window.getAttention();
 }
 
 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);
-    }
-}