mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-04 11:24:10 +01:00
Fix some brokenness
This commit is contained in:
@@ -1560,15 +1560,15 @@ liberator.Events = function () //{{{
|
||||
{
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefService);
|
||||
this._branch = prefService.getBranch(""); // better way to monitor all changes?
|
||||
this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
this._branch.addObserver("", this, false);
|
||||
this._branch = prefService.getBranch(""); // better way to monitor all changes?
|
||||
this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
this._branch.addObserver("", this, false);
|
||||
},
|
||||
|
||||
unregister: function ()
|
||||
{
|
||||
if (!this._branch) return;
|
||||
this._branch.removeObserver("", this);
|
||||
if (this._branch)
|
||||
this._branch.removeObserver("", this);
|
||||
},
|
||||
|
||||
observe: function (aSubject, aTopic, aData)
|
||||
@@ -1603,7 +1603,10 @@ liberator.Events = function () //{{{
|
||||
catch (e) {}
|
||||
|
||||
eventManager.prefObserver.register();
|
||||
liberator.registerCallback("shutdown", 0, eventManager.destroy);
|
||||
liberator.registerObserver("shutdown", function () {
|
||||
eventManager.destroy();
|
||||
eventManager.prefObserver.unregister();
|
||||
});
|
||||
|
||||
window.addEventListener("keypress", eventManager.onKeyPress, true);
|
||||
window.addEventListener("keydown", eventManager.onKeyUpOrDown, true);
|
||||
|
||||
Reference in New Issue
Block a user