mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-07 13:24:12 +00:00
Bug 480080 - updateStatusBar not defined in gSelectionListener in viewSource.js (when it's getting notified of a selection change after the window has already closed), r=gavin
This commit is contained in:
parent
831a3e736d
commit
73396dba13
@ -59,6 +59,7 @@ try {
|
||||
|
||||
var gSelectionListener = {
|
||||
timeout: 0,
|
||||
attached: false,
|
||||
notifySelectionChanged: function(doc, sel, reason)
|
||||
{
|
||||
// Coalesce notifications within 100ms intervals.
|
||||
@ -295,6 +296,7 @@ function onLoadContent()
|
||||
window.content.getSelection()
|
||||
.QueryInterface(nsISelectionPrivate)
|
||||
.addSelectionListener(gSelectionListener);
|
||||
gSelectionListener.attached = true;
|
||||
}
|
||||
|
||||
function onUnloadContent()
|
||||
@ -304,6 +306,15 @@ function onUnloadContent()
|
||||
// or toggling of syntax highlighting.
|
||||
//
|
||||
document.getElementById('cmd_goToLine').setAttribute('disabled', 'true');
|
||||
|
||||
// If we're not just unloading the initial "about:blank" which doesn't have
|
||||
// a selection listener, get rid of it so it doesn't try to fire after the
|
||||
// window has gone away.
|
||||
if (gSelectionListener.attached) {
|
||||
window.content.getSelection().QueryInterface(nsISelectionPrivate)
|
||||
.removeSelectionListener(gSelectionListener);
|
||||
gSelectionListener.attached = false;
|
||||
}
|
||||
}
|
||||
|
||||
function HandleAppCommandEvent(evt)
|
||||
|
Loading…
Reference in New Issue
Block a user